Validate options
974475
function validate({ separator, transformer }) {
  /* separator */
  if (null != separator) {
    if ('string' !== typeof separator) {
      throw new Error(`The separator must be a string: "${separator}".`)
    } else if (INVALID_SEPARATOR.test(separator)) {
      throw new Error(`The separator has invalid characters: "${separator}".`)
    }
  }
  /* transformer */
  if (null != transformer) {
    if (false !== transformer
      && 'function' !== typeof transformer
      && !defaultTransformers[transformer] /* TODO Deprecate */
    ) {
      throw new Error(`The transformer must be a function: "${transformer}".`)
    }
  }
}
242404
def validate_string(option, value):
    
    if isinstance(value, string_type):
        return value
    raise TypeError("Wrong type for %s, value must be "
                    "an instance of %s" % (option, string_type.__name__))
484179
function getValidOptions (options) {
  if (typeof options !== 'object') {
    return DEFAULT_OPTIONS
  }

  var validOptions = {}

  for (var prop in DEFAULT_OPTIONS) {
    if (DEFAULT_OPTIONS.hasOwnProperty(prop)) {
      validOptions[prop] = typeof options[prop] === 'string'
        ? options[prop] : DEFAULT_OPTIONS[prop]
    }
  }

  return validOptions
}
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
56328
def validate_options(node, options, environments)
      if options =~ /-E/ # check for environments
        env = options.split("-E")[1].split[0]
        unless environments.member?(env)
          STDERR.puts "ERROR: '#{node}' environment '#{env}' is missing from the list of environments in the manifest."
          exit(-1)
        end
      end
    end
822980
function validateProps(element, props) {
  // TODO (yungsters): Remove support for `selected` in <option>.
  {
    if (props.selected != null && !didWarnSelectedSetOnOption) {
      warning(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
      didWarnSelectedSetOnOption = true;
    }
  }
}
717829
function validate( options ) {
		var validator,
			keys,
			key,
			err;

		if ( !isObject( options ) ) {
			return new TypeError( 'Stream()::invalid input argument. Options must be an object.' );
		}
		keys = Object.keys( options );
		for ( var i = 0; i < keys.length; i++ ) {
			key = keys[ i ];
			validator = validators[ key ];
			err = validator( options[key] );
			if ( err ) {
				return err;
			}
		}
	}
778141
def validate_options(self, k, v):
        """"""

        super().validate_options(k, v)
        if k == 'errors' and v.lower() not in ('strict', 'replace', 'ignore', 'backslashreplace'):
            raise ValueError("{}: '{}' is not a valid value for '{}'".format(self.__class__.__name, v, k))
        if k == 'normalize' and v.upper() not in ('NFC', 'NFKC', 'NFD', 'NFKD'):
            raise ValueError("{}: '{}' is not a valid value for '{}'".format(self.__class__.__name, v, k))
898403
function isValid (options) {
  const types = options ? options.types : undefined
  return Array.isArray(types)
}
928130
def validate(self, value):
        """"""
        if self.required and value is None:
            raise ValidationError("field is required")

        if value is not None and self.choices is not None:
            choices = [choice for choice, _ in self.choices]
            if value not in choices:
                raise ValidationError("field must be one of: {}".format(
                    ", ".join(choices),
                ))
531705
function validateParams (params) {
  if (!params) {
    throw new Error('Transloadit: The `params` option is required.')
  }

  if (typeof params === 'string') {
    try {
      params = JSON.parse(params)
    } catch (err) {
      // Tell the user that this is not an Uppy bug!
      err.message = 'Transloadit: The `params` option is a malformed JSON string: ' +
        err.message
      throw err
    }
  }

  if (!params.auth || !params.auth.key) {
    throw new Error('Transloadit: The `params.auth.key` option is required. ' +
      'You can find your Transloadit API key at https://transloadit.com/account/api-settings.')
  }
}
373811
function validateOptions(options) {
  const {
    lifecycleExperimental,
    disableLifecycleMethods,
    enableComponentDidUpdateOnSetState,
    supportPrevContextArgumentOfComponentDidUpdate,
    lifecycles,
  } = options;
  if (typeof lifecycleExperimental !== 'undefined' && typeof lifecycleExperimental !== 'boolean') {
    throw new Error('lifecycleExperimental must be either true or false if provided');
  }

  if (typeof disableLifecycleMethods !== 'undefined' && typeof disableLifecycleMethods !== 'boolean') {
    throw new Error('disableLifecycleMethods must be either true or false if provided');
  }

  if (
    lifecycleExperimental != null
    && disableLifecycleMethods != null
    && lifecycleExperimental === disableLifecycleMethods
  ) {
    throw new Error('lifecycleExperimental and disableLifecycleMethods cannot be set to the same value');
  }

  if (
    typeof enableComponentDidUpdateOnSetState !== 'undefined'
    && lifecycles.componentDidUpdate
    && lifecycles.componentDidUpdate.onSetState !== enableComponentDidUpdateOnSetState
  ) {
    throw new TypeError('the legacy enableComponentDidUpdateOnSetState option should be matched by `lifecycles: { componentDidUpdate: { onSetState: true } }`, for compatibility');
  }

  if (
    typeof supportPrevContextArgumentOfComponentDidUpdate !== 'undefined'
    && lifecycles.componentDidUpdate
    && lifecycles.componentDidUpdate.prevContext !== supportPrevContextArgumentOfComponentDidUpdate
  ) {
    throw new TypeError('the legacy supportPrevContextArgumentOfComponentDidUpdate option should be matched by `lifecycles: { componentDidUpdate: { prevContext: true } }`, for compatibility');
  }
}
663211
protected static function validateOptions(array $options = []): void
    {
        if (empty($options)) {
            return;
        }

        $validOptions = [
            'save_path',
            'name',
            'save_handler',
            'auto_start',
            'gc_probability',
            'gc_divisor',
            'gc_maxlifetime',
            'serialize_handler',
            'cookie_lifetime',
            'cookie_path',
            'cookie_domain',
            'cookie_secure',
            'cookie_httponly',
            'use_strict_mode',
            'use_cookies',
            'use_only_cookies',
            'referer_check',
            'cache_limiter',
            'cache_expire',
            'use_trans_sid',
            'trans_sid_tags',
            'trans_sid_hosts',
            'sid_length',
            'sid_bits_per_character',
            'upload_progress.enabled',
            'upload_progress.cleanup',
            'upload_progress.prefix',
            'upload_progress.name',
            'upload_progress.freq',
            'upload_progress.min_freq',
            'lazy_write',
            'read_and_close'
        ];

        $keys = \array_keys($options);
        foreach ($keys as $key) {
            if (!\in_array($key, $validOptions, true)) {
                throw new SessionException('Incorrect option: ' . $key);
            }
        }
    }
1194913
function Validator(options) {
  options = options || {};

  this.cwd = options.cwd || process.cwd();
  this.debug = !!options.debug;
}
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
1256133
function validate(options) {
    const schema = joi.object().keys({
        actionName: joi.string().required(),
        authKey: joi.string().required(),
        modelName: joi.string().required(),
        acl: joi.object(),
        aclContextName: joi.string().required()
    });
    const errorMsg = 'Invalid rule options: ';
    const aclContext = options.acl[options.aclContextName];
    joi.assert(options, schema, errorMsg);
    joi.assert(aclContext, joi.func().required(), errorMsg);
    return true;
}
1006975
function validateOptions(options) {
  const notSupported = _.reject(_.keys(options), (key) => (
    OPTIONS.has(key)
  ));

  if (notSupported.length > 0) {
    console.warn(`[${PLUGIN_NAME}] Options ${notSupported} are not supported, use following options: ${Array.from(OPTIONS)}`);
  }
}