Takes in a list of valid option keys and a hash of options. If one of the
 keys in the hash is invalid an ArgumentError will be raised.

 @param valid_option_keys List of valid keys for the options hash.
 @param options [Hash] Options hash.
552679
def validate_options(valid_option_keys, options)
      options.keys.each do |key|
        unless valid_option_keys.include? key.to_sym
          raise ArgumentError, "Invalid option `#{key}`"
        end
      end
    end
1082876
@SuppressWarnings("UnusedDeclaration")
    public static boolean validOptions(String[][] options, DocErrorReporter errorReporter) {
        return validOptions(options, errorReporter, new StandardAdapter());
    }
322139
def options_hash_to_string(options)
      result = ''
      options.sort_by { |key, _| OPTION_ORDER.find_index(key) || -1 }.each do |key, value|
        if value
          result += "set #{OptionHandling.option_to_string(key, value)}\n"
        else
          result += "unset #{key}\n"
        end
      end
      result
    end
430938
def parse_options(options={})
      options.each do |key, value|
        key = :"#{key}="
        self.send(key, value) if !value.nil? && self.respond_to?(key)
      end
    end
882268
def apply_options! options = {}
      options.each_pair do |key, value| 
        send("#{key}=", value) if self.respond_to?(:"#{key}=")
      end      
    end
366521
protected function checkOptionsArray(array $options, array $keys)
    {
        foreach ($keys as $intOption) {
            if (isset($options[$intOption]) && !is_array($options[$intOption])) {
                throw new InvalidOptionException($this, $options);
            }
        }
    }
1002569
def register_optionables(self, optionables):
    
    if not isinstance(optionables, Iterable):
      raise TypeError('The optionables must be an iterable, given {}'.format(optionables))
    optionables = tuple(optionables)
    if not optionables:
      return

    invalid_optionables = [s
                           for s in optionables
                           if not isinstance(s, type) or not issubclass(s, Optionable)]
    if invalid_optionables:
      raise TypeError('The following items from the given optionables are not Optionable '
                      'subclasses:\n\t{}'.format('\n\t'.join(str(i) for i in invalid_optionables)))

    self._optionables.update(optionables)
42650
function validateOptions (options) {
  if (typeof options.apiKey !== 'string') {
    throw new Error('You must provide a valid API key to upload sourcemaps to Bugsnag.')
  }
  if (typeof options.sourceMap !== 'string') {
    throw new Error('You must provide a path to the source map you want to upload.')
  }
  if (options.addWildcardPrefix && !options.stripProjectRoot) {
    options.stripProjectRoot = true
  }
  if (options.uploadSources && !options.projectRoot) {
    throw new Error('You must provide a project root when uploading sources. ' +
      'The project root is used to generate relative paths to the sources.')
  }
  if (options.stripProjectRoot && !options.projectRoot) {
    throw new Error('You must provide a project root when stripping the root ' +
      'path from the source map.')
  }
  if (options.projectRoot && !path.isAbsolute(options.projectRoot)) {
    options.projectRoot = path.resolve(options.projectRoot)
  }
  return options
}
1364145
def update_options(composite_key, value, options)
      nesting = options
      keys = composite_key.sub(/\A--/, "").split(":")
      keys.each_with_index do |key, i|
        key = key.to_sym
        if i < keys.length - 1
          nesting[key] ||= {}
          nesting = nesting[key]
        else
          nesting[key] = parse_possible_boolean(value)
        end
      end
      options
    end
295581
public void setOptions(Set<Option> options) {
        this.options = (options == null)
                       ? Collections.<Option>emptySet()
                       : new HashSet<Option>(options);
    }
482031
def options
      OPTION_KEYS.inject({}){|o,k|o.merge!(k => send(k))}
    end
266583
function isValid(options, key) {
    var value = _.isFunction(options) ? options(key) : options[key];

    if (typeof value === 'undefined') {
        return false;
    }

    if (value === null) {
        return false;
    }

    if (value === '') {
        return false;
    }

    if (_.isNaN(value)) {
        return false;
    }

    return true;
}
429388
def is_valid?
      site_option_valid               = !site.nil? && !site.empty?
      api_key_option_valid            = !api_key.nil? && !api_key.empty?
      use_ssl_option_valid            = !use_ssl.nil? && !!use_ssl == use_ssl # Check this is a boolean
      api_version_option_valid        = !api_version.nil? && !api_version.empty?
      project_name_option_valid       = !project_name.nil? && !project_name.empty?
      ignored_paths_option_valid      = ignored_paths.kind_of?(Array)

      site_option_valid && api_key_option_valid && use_ssl_option_valid && api_version_option_valid &&
      project_name_option_valid && ignored_paths_option_valid
    end
1208983
def options=(options)
      @options = options
      children.each do |c|
        if c.is_a? Hash
          c.values.each {|v| v.options = options}
        else
          c.options = options
        end
      end
    end
301113
def valid?(options)
      valid_options = Loaf::Configuration::VALID_ATTRIBUTES
      options.each_key do |key|
        unless valid_options.include?(key)
          fail Loaf::InvalidOptions.new(key, valid_options)
        end
      end
      true
    end
774560
def option(key, *value)
      if value.empty?
        value = options[key]
        value = value[0] if value && value.size == 1
        value
      else
        options(key => value)
      end
    end
446930
def init_options(args = nil)
      @args = case args
              when nil    then []
              when String then args.split
              else             args
              end

      @options = load_config || {}

      Kat.options(@args).tap do |o|
        @options.merge!(o) { |k, ov, nv| o["#{ k }_given".intern] ? nv : ov }
      end

      Kat::Colour.colour = @options[:colour]
    rescue NoMethodError => e
      @options = {}
      warn "Wrong config file format: #{ e }"
    end