Define an alias to a nested key

 @example
   alias_setting(:foo, to: :bar)

 @param [Array[String]] keys
   the alias key

 @api public
490354
def alias_setting(*keys, to: nil)
      flat_setting = flatten_keys(keys)
      alias_keys = Array(to)
      alias_key = flatten_keys(alias_keys)

      if alias_key == flat_setting
        raise ArgumentError, 'Alias matches setting key'
      end

      if fetch(alias_key)
        raise ArgumentError, 'Setting already exists with an alias ' \
                             "'#{alias_keys.map(&:inspect).join(', ')}'"
      end

      @aliases[alias_key] = flat_setting
    end
931138
def stringify_keys(allowed: nil)
      allowed ||= self.class.allowed[:keys]
      each_with_object({}) do |(k, v), h|
        k = k.to_s unless allowed.include?(k.class)
        h[k] = !v.respond_to?(:stringify_keys) ? v : v.stringify_keys({
          :allowed => allowed
        })
      end
    end
229537
def register_alias(self, alias, key):
        
        alias = alias.lower()
        key = key.lower()
        if alias != key and alias != self._real_key(key):
            exists = self._aliases.get(alias)

            if exists is None:
                # if we alias something that exists in one of the dicts to
                # another name, we'll never be able to get that value using the
                # original name, so move the config value to the new _real_key.
                val = self._config.get(alias)
                if val:
                    self._config.pop(alias)
                    self._config[key] = val
                val = self._kvstore.get(alias)
                if val:
                    self._kvstore.pop(alias)
                    self._kvstore[key] = val
                val = self._defaults.get(alias)
                if val:
                    self._defaults.pop(alias)
                    self._defaults[key] = val
                val = self._override.get(alias)
                if val:
                    self._override.pop(alias)
                    self._override[key] = val

                self._aliases[alias] = key
        else:
            log.warning("Creating circular reference alias {0} {1} {2}".format(
                alias, key, self._real_key(key)))
1015466
def hash_of(*keys)
      keys.each.with_object({}){|k,h| h[k] = send(k) }
    end
1102275
def symbolize_keys(hash)
      hash.each_with_object({}) { |(k, v), memo| memo[k.to_sym] = v }
    end
1282034
def set(key, value = nil)
      if key.is_a?(Hash)
        properties.merge!(key)
      else
        properties[key] = value
      end
    end
167719
def symbolize_keys(hash)
      hash.keys.each do |key|
        hash[(key.to_sym rescue key) || key] = hash.delete(key)
      end
      hash
    end
1198137
def validate_keys(*valid_keys)
      valid_keys.flatten!
      @hash.each_key do |k|
        unless valid_keys.include?(k)
          raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}")
        end
      end
    end
1340129
public function setQueryKeys(array $keys)
    {
        $this->queryKeys = [];

        foreach ($keys as $key) {
            if (is_string($key)) {
                $this->addQueryKey($key);
            }
        }

        return $this;
    }
1168046
def set_from_env(*keys, &block)
      assert_keys_with_block(convert_to_keys(keys), block)
      key = flatten_keys(keys)
      env_key = block.nil? ? key : block.()
      env_key = to_env_key(env_key)
      @envs[key.to_s.downcase] = env_key
    end
910966
public void setKeys(java.util.Collection<Key> keys) {
        if (keys == null) {
            this.keys = null;
            return;
        }

        java.util.List<Key> keysCopy = new java.util.ArrayList<Key>(keys.size());
        keysCopy.addAll(keys);
        this.keys = keysCopy;
    }
1250603
def set_if_empty(*keys, value: nil, &block)
      return unless deep_find(@settings, keys.last.to_s).nil?
      block ? set(*keys, &block) : set(*keys, value: value)
    end
1063580
def []( *key )
            if Hash === @value
                v = @value.detect { |k,| k.transform == key.first }
                v[1] if v
            elsif Array === @value
                @value.[]( *key )
            end
        end
1342882
def deep_set_symbol_key(hash, key, value)
      if value.kind_of? Hash
        hash[key.to_sym] = value.inject({}) { |inner_hash, (inner_key, inner_value)| deep_set_symbol_key(inner_hash, inner_key, inner_value) }
      else
        hash[key.to_sym] = value
      end
      hash
    end
334419
def add_keys(*additional_keys)
      additional_keys = additional_keys.flatten.compact
      @opts[:keys] ||= []
      @opts[:keys] += additional_keys
      @opts[:keys].uniq!
      @boxes.each do |box|
        box.add_keys *additional_keys
      end
      self
    end
1321398
def fetch(*keys, default: nil, &block)
      # check alias
      real_key = @aliases[flatten_keys(keys)]
      keys = real_key.split(key_delim) if real_key

      keys = convert_to_keys(keys)
      env_key = autoload_env? ? to_env_key(keys[0]) : @envs[flatten_keys(keys)]
      # first try settings
      value = deep_fetch(@settings, *keys)
      # then try ENV var
      if value.nil? && env_key
        value = ENV[env_key]
      end
      # then try default
      value = block || default if value.nil?

      while callable_without_params?(value)
        value = value.call
      end
      value
    end
715722
def keys
      @hash.deep.each_with_object([]) do |(key_path, value), result|
        result << key_path.to_key_path unless value.is_a?(Hash)
      end
    end