Slice the given list of options with the given keys.

 @param [Hash] options
   the list of options to slice
 @param [Array<Object>] keys
   the keys to slice

 @return [Hash]
   the sliced hash
323452
def slice(options, *keys)
      keys.inject({}) do |hash, key|
        hash[key] = options[key] if options[key]
        hash
      end
    end
889710
def flatten_keys(hash, prev_key=nil, &block)
      hash.each_pair do |key, value|
        curr_key = [prev_key, key].compact.join('.')
        if value.is_a?(Hash)
          flatten_keys(value, curr_key, &block)
        else
          yield curr_key, value
        end
      end
    end
104746
def batch_slice_columns(slice_columns)
      use_indexes = []
      headers.values.each_with_index do |val, index|
        use_indexes << index if val.in?(slice_columns)
      end
      return csv_lines if use_indexes.empty?
      # slice CSV headers
      @headers = headers.to_a.values_at(*use_indexes).to_h
      # slice CSV values
      csv_lines.map! do |line|
        line.values_at(*use_indexes)
      end
    end
567248
function (keys) {
    var Parent = this.constructor;
    var opts = lazy.clone(this.options);
    var res = new Parent(opts);

    lazy.omit(this, keys, function (val, key) {
      res[key] = lazy.clone(val);
    });
    return res;
  }
1269289
function (key) {
                    this._initializeKeys();
                    var args = copyargs(arguments);
                    args[0] = this._keys.indexOf(key);
                    return this.splice.apply(this, args);
                }
1059347
def normalize_keys(hash)
        hash.inject({}) do |options, (key, value)|
          options[(underscore(key) rescue key) || key] = normalize_value(value)
          options
        end
      end
337240
def _keys(result, key_ary, hash)
      hash.each do |key, value|
        key_ary << key
        result << "/#{key_ary.join('/')}"
        _keys(result, key_ary, value) if value.is_a?(Hash)
        key_ary.pop
      end
    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
1110861
public static <T> List<T> slice(List<T> list, int... indexes) {
		List<T> slice = new ArrayList<>(indexes.length);
		for (int i : indexes) {
			slice.add(list.get(i));
		}
		return slice;
	}
775374
def slice_cardinal(self, key):
        
        cls = self.__class__
        key = check_key(self, key, cardinal=True)
        return cls(self[self[self._cardinal[0]].isin(key)])
935897
def make_slice_strings(cls, slice_key):
        
        start = slice_key.start
        size = slice_key.stop - start
        return (str(start), str(size))
1192002
def [](key)
      if self.map? && @data.has_key?(key)
        @data[key]
      elsif (self.map?  && @data.has_value?(key)) ||
            (self.list? && @data.include?(key))
        key
      else
        nil
      end
    end
736481
def options
      Hash[*Vault::Configurable.keys.map do |key|
        [key, instance_variable_get(:"@#{key}")]
      end.flatten]
    end
965852
def flatten_nested_keys(body)
      options = {}
      body.each do |key, value|
        next unless value.is_a?(Hash)
        value = flatten_nested_keys(value.dup)
        value.each do |nested_key, nested_value|
          options["#{key}/#{nested_key}"] = nested_value
        end
        body.delete(key)
      end
      body.merge(options)
    end
1307663
def rearrange_options!(args, options)
      prefix_options = {}
      (PREFIX_OPTIONS + PREFIX_OPTIONS.map { |o| o.to_s }).each do |k|
        if options.has_key?(k)
          value = options.delete(k)
          prefix_options[k.to_sym] = value
        end
      end
      hash_to_options(prefix_options).reverse.each { |o| args.unshift(o) }
    end
515508
def slice_config(config, key):
    
    if key:
        keys = key.split('.')
        for k in keys:
            config = config[k]

    return config
29656
function splitKeys (keys) {
		if (typeof(keys) === 'string') {
			return keys.replace(/^\s*\.\s*/,'')
				.replace(/(?:\s*\.\s*)+/g, '.')
				.split('.');
		}
		else if (Array.isArray(keys)) {
			return [].concat(keys);
		}
		return;
	}