Checks if provided option is a hash and if the keys are not in confict with OpenStruct public methods.
422584
def check_hash_for_conflicts(hash)
      raise HashArgumentError, 'It must be a hash' unless hash.is_a?(Hash)

      unless (conflicts = self.public_methods & hash.keys.map(&:to_sym)).empty?
        raise HashArgumentError, "Rename keys in order to avoid conflicts with internal calls: #{conflicts.join(', ')}"
      end
    end
898774
function isOption(option) {
  if (!option || typeof option !== 'object') {
    return false;
  }

  let allOptions = Object.keys(defaultRouteOptions);
  let optionKeys = Object.keys(option);
  for (let i = 0; i < optionKeys.length; i++) {
    let key = optionKeys[i];
    if (allOptions.indexOf(key) > -1) {
      return true;
    }
  }
  return false;
}
1069891
function expectKey(options, key, type) {
  if (key in options) {
    if (typeof options[key] === type) {
      return true
    }
    // eslint-disable-next-line no-console
    console.warn(`Ignoring options key '${key}' - ` +
      `expected type '${type}', received '${typeof options[key]}'`)
  }
  return false
}
729836
def basic_options
      Hash[BASIC_OPTION_KEYS.map { |k| [k, send(k)] }].reject {|_,v| v.nil?}
    end
10298
def has_key(cls, *args):
        
        key = args if len(args) > 1 else args[0]
        return key in cls._instances
944132
function validateHeader (key, value) {
  if (typeof key !== 'string' || typeof value !== 'string')
    return option.some(`Parts of header ${key}:${value} must be strings`)
  return option.none
}
748621
def has_serialized(name, &block)
      serialize name, Hash

      initializer = Serializer::Initializer.new
      block.call(initializer)

      initializer.each do |method, options|

        define_method "#{method}" do
          hash = send(name)
          result = hash[method.to_sym] if hash

          if hash.nil? or result.nil?
            send("#{name}=", {}) unless send(name)
            hash = send(name)

            result = options[:default]
            result = result.clone if result.duplicable?

            hash[method.to_sym] = result
          end

          return result
        end

        define_method "#{method}?" do
          hash = send(name)
          result = hash[method.to_sym] if hash

          if hash.nil? or result.nil?
            send("#{name}=", {}) unless send(name)
            hash = send(name)

            result = options[:default]
            result = result.clone if result.duplicable?

            hash[method.to_sym] = result
          end

          return result
        end

        define_method "#{method}=" do |value|
          original = send(name) || {}

          if options[:type] and value
            case options[:type].to_sym
            when :float   then value = value.to_f if value.respond_to? :to_f
            when :integer then value = value.to_i if value.respond_to? :to_i
            when :string  then value = value.to_str if value.respond_to? :to_str
            when :symbol  then value = value.to_sym if value.respond_to? :to_sym
            when :boolean then
              value = true  if value.eql? "true"
              value = false if value.eql? "false"
              value = !value.to_i.zero? if value.respond_to? :to_i
            end
          end

          modified = original.clone
          modified[method.to_sym] = value

          send("#{name}_will_change!") unless modified.eql?(original)
          send("#{name}=", modified)
        end

      end
    end
1059347
def normalize_keys(hash)
        hash.inject({}) do |options, (key, value)|
          options[(underscore(key) rescue key) || key] = normalize_value(value)
          options
        end
      end
326105
def valid_hash_value(hashname):
    
    custom_hash_prefix_re = re.compile(r"^x_")
    if hashname in enums.HASH_ALGO_OV or custom_hash_prefix_re.match(hashname):
        return True
    else:
        return False
1352123
def options
      VALID_OPTIONS_KEYS.reduce({}) do |option, key|
        option.merge!(key => send(key))
      end
    end
1162413
function generateHashForOptions (options) {
  var hash = crypto.createHash('md5');
  hash.update(JSON.stringify(options));
  return hash.digest('hex');
}
332353
function hasOwnProperties(exclude) {
    const arg = this;
    if (!isObjectLike(arg)) return false;

    if (!isValid(exclude)) {
        const keys = Object.keys(arg);
        return keys.length > 0;
    }
    return !!eachProp.call(arg, resolveTestFunc(exclude, objectHasNotOwnPropertyBreakTrue, arrayContainsNotKeyBreakTrue, testFuncNotBreakTrue, alwaysBreakTrue, keyNotEqualsBreakTrue), exclude);
}
172366
function verifyOptionType(sourcePath, name, value) {
  if (typeof value === 'object') {
    var msg = 'POSTCSS-HASH-CLASSNAME ERROR: Object value not supported for option "' + name + '"!';
    console.error(msg);
    throw new Error(msg);
  } else if (!sourcePath && typeof value === 'function') {
    var msg = 'POSTCSS-HASH-CLASSNAME ERROR: Source file\'s path isn not determined - only explicit values for option "' + name + '" supported! Value passed is a function.';
    console.error(msg);
    throw new Error(msg);
  } else if (!sourcePath && ((value.toString().indexOf('[') >= 0) || (value.toString().indexOf(']') >= 0))) {
    var msg = 'POSTCSS-HASH-CLASSNAME WARNING: Source file\'s path isn not determined - only explicit values for option "' + name + '" supported! Value passed detected as using templating.';
    console.warn(msg);
  }
}
904987
def default_params(h = {})
      raise ArgumentError, 'Default params must be an object which responds to #to_hash' unless h.respond_to?(:to_hash)
      default_options[:default_params] ||= {}
      default_options[:default_params].merge!(h)
    end
878617
def html_safe_options(hash)
      hash.inject({}) do |result, (key, value)|
        result[key] = case value
          when String
            ERB::Util.h(value)
          else
            value
          end

        result
      end
    end
228674
def safe_hash
      Hash[map do |key, value|
        if Protocol::RESERVED_KEYS.include?(key)
          nil
        elsif value.is_a?(Hash) &&
              value[Protocol::KEY_TYPE] == Protocol::TYPE_RELATION
          nil
        elsif value.nil?
          [key, Protocol::DELETE_OP]
        else
          [key, Parse.pointerize_value(value)]
        end
      end.compact]
    end
778305
def _validate_and_get_value(options, options_name, key, _type):
  
  if isinstance(options, dict):
    has = lambda k: k in options
    get = lambda k: options[k]
  elif isinstance(options, object):
    has = lambda k: hasattr(options, k)
    get = lambda k: getattr(options, k)
  else:
    raise ImproperlyConfigured(
        '`{}` must be a dictionary-like object.'.format(options_name))

  if not has(key):
    raise ImproperlyConfigured(
        '`{}` must be specified in `{}`'.format(key, options_name))

  value = get(key)
  if not isinstance(value, _type):
    raise ImproperlyConfigured(
        '`{}` in `{}` must be a {}'.format(key, options_name, repr(_type)))

  return value