Rename a list of keys to the given map.

 @example Rename the given keys
   rename_keys(hash, foo: :bar, zip: :zap)

 @param [Hash] options
   the options to map
 @param [Hash] map
   the map of keys to map

 @return [Hash]
977991
def rename_keys(options, map = {})
      Hash[options.map { |k, v| [map[k] || k, v] }]
    end
323452
def slice(options, *keys)
      keys.inject({}) do |hash, key|
        hash[key] = options[key] if options[key]
        hash
      end
    end
1192358
def plan_rename
      ref = @dao.applied_patches_inverse
      m = {}
      @patches.each do |patch|
        old_name = ref[patch.signature]
        raise NotAppliedError, patch if old_name.nil?
        raise DuplicateError, [patch.name, m[old_name]] if m.key?(old_name)
        m[old_name] = patch.name
      end
      m.select { |old_name, new_name| old_name != new_name }
    end
1024503
def _select_options(self, options, keys, invert=False):
        
        options = self._merge_options(options)
        result = {}
        for key in options:
            if (invert and key not in keys) or (not invert and key in keys):
                result[key] = options[key]
        return result
1215943
public String rename(Object oldkey, Object newkey) {
		Jedis jedis = getJedis();
		try {
			return jedis.rename(keyToBytes(oldkey), keyToBytes(newkey));
		}
		finally {close(jedis);}
	}
706050
def _remap_key(key):
    
    if key in KNOWN_PARAMS:
        return key
    if key.lower() in known_params:
        return KNOWN_PARAMS[known_params.index(key.lower())]
    return key
1309829
def string_keys(hash={})
      hash.inject({}) do |options, (key, value)|
        options[key.to_s] = value
        options
      end
    end
755026
def rename(name, options={})
      result = @session.rename(path, name, options)
      @path = result.path.gsub(/^\//, '')
      return result
    end
646230
def rename_nodes(self, renaming_map):
        '''
        '''
        if not isinstance(renaming_map, dict):
            raise TypeError("renaming_map must be a dict")
        for node in self.traverse_preorder():
            if node.label in renaming_map:
                node.label = renaming_map[node.label]
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
1083083
def delete(key, options = {})
      custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil
      ret = send_delete_request(@conn, ["/v1/query/#{key}"], options, custom_params)
      ret.status == 200
    end
721466
def buffer_key(key, opts)
      # covert keys to strings, as sorting a Hash with Symbol keys fails on
      # Ruby 1.8.x.
      opts = opts.inject({}) do |result, (k, v)|
        result[k.to_s] = v
        result
      end
      "#{key.to_s}:#{opts.sort.flatten.join(':')}"
    end
307797
def normalize_options(options)
      case options
      when Hash
        Hash[options.map{|k,v| [k.respond_to?(:to_sym) ? k.to_sym : k, v]}].tap do |opts|
          opts[:driver] = opts[:driver].to_s if opts[:driver]
        end
      when String, URI
        parse_connection_uri(options)
      else
        raise RDO::Exception,
          "Unsupported connection argument format: #{options.class.name}"
      end
    end
1354762
def slice(*keys, **options)
      return super if options.include?(:raw)
      new_expires = expires_at(options, nil)
      options = Utils.without(options, :expires)

      with_updates(options) do |updates|
        @adapter.slice(*keys, **options).map do |key, entry|
          entry = invalidate_entry(key, entry, new_expires) do |new_entry|
            updates[key] = new_entry
          end
          next if entry.nil?
          value, _ = entry
          [key, value]
        end.reject(&:nil?)
      end
    end
1245850
def rename(self, old_key, new_key):
        
        return lib.zhash_rename(self._as_parameter_, old_key, new_key)
1156827
def redefine_commands(lib, commands)
      option_commands = lib.command_objects(commands).select(&:option_command?)
      accepted, rejected = option_commands.partition {|e|
        e.args(lib) || e.arg_size }
      if verbose && rejected.size > 0
        puts "Following commands cannot have options until their arguments " +
          "are configured: " + rejected.map {|e| e.name}.join(', ')
      end
      accepted.each {|cmd| Scientist.redefine_command(lib.namespace_object, cmd) }
    end
794874
def rename_key(d: Dict[str, Any], old: str, new: str) -> None:
    
    d[new] = d.pop(old)