Reduce the amount of data we have to sift through to only
        include the specified keys, and children that contain the
        specified keys
965311
def _prune(current, keys):
    
    pruned_current = {k: current[k] for k in keys if k in current}
    pruned_children = list(
        filter(
            None, [_prune(c, keys) for c in current.get("IORegistryEntryChildren", [])]
        )
    )
    keep_current = any(k in current for k in keys) or pruned_children
    if keep_current:
        if pruned_children:
            pruned_current["IORegistryEntryChildren"] = pruned_children
        return pruned_current
    else:
        return {}
294743
@Override
  public void reduceToSegmentKeys() {
    if (segmentRegistration != null && size > 0) {
      int sizeCopy = size;
      String[] keyListCopy = keyList.clone();
      T1[] basicValueSumListCopy = basicValueSumList.clone();
      long[] basicValueNListCopy = basicValueNList.clone();
      size = 0;
      for (int i = 0; i < sizeCopy; i++) {
        if (segmentKeys.contains(keyListCopy[i])) {
          keyList[size] = keyListCopy[i];
          basicValueSumList[size] = basicValueSumListCopy[i];
          basicValueNList[size] = basicValueNListCopy[i];
          size++;
        }
      }
    }
  }
644312
def stringify_keys
      reduce({}) { |hsh, (k, v)| hsh.merge(k.to_s => v) }
    end
659463
def prune
      @store.keys.reject { |k| include? k }.map { |k| clear!(k) && k }
    end
88958
@Override
  public void reduceToSegmentKeys() {
    if (segmentRegistration != null && size > 0) {
      int sizeCopy = size;
      String[] keyListCopy = keyList.clone();
      T1[] advancedValueSumListCopy = advancedValueSumList.clone();
      T1[] advancedValueMaxListCopy = advancedValueMaxList.clone();
      T1[] advancedValueMinListCopy = advancedValueMinList.clone();
      T1[] advancedValueSumOfSquaresListCopy = advancedValueSumOfSquaresList
          .clone();
      T2[] advancedValueSumOfLogsListCopy = advancedValueSumOfLogsList.clone();
      long[] advancedValueNListCopy = advancedValueNList.clone();
      size = 0;
      for (int i = 0; i < sizeCopy; i++) {
        if (segmentKeys.contains(keyListCopy[i])) {
          keyList[size] = keyListCopy[i];
          advancedValueSumList[size] = advancedValueSumListCopy[i];
          advancedValueMaxList[size] = advancedValueMaxListCopy[i];
          advancedValueMinList[size] = advancedValueMinListCopy[i];
          advancedValueSumOfSquaresList[size] = advancedValueSumOfSquaresListCopy[i];
          advancedValueSumOfLogsList[size] = advancedValueSumOfLogsListCopy[i];
          advancedValueNList[size] = advancedValueNListCopy[i];
          size++;
        }
      }
    }
  }
515201
function processPartitionKeys(keys){
    var result = "(",
        j,
        len,
        keyGroup;

    if(typeof keys === 'string'){
        return result += keys + ")";
    }

    len = keys.length;
    for(j = 0; j< keys.length; j++){
        keyGroup = keys[j];
        if(keyGroup instanceof Array){
            result += "(";
            result += keyGroup.join(", ");
            result += ")";
        }else{
            result += keyGroup;
        }
        result += (j < len-1) ? ", " : "";
    }
    result += ")";

    return result;
}
1108859
def snakeize_keys
      self.keys.each_with_index do |key, i|
        if key != key.underscore
          self.insert(i, key.underscore, self[key])
          self.delete(key)
        end
      end
      self
    end
56465
def remove_values(self, keys):
        """"""
        data = self.model.get_data()
        for key in sorted(keys, reverse=True):
            data.pop(key)
            self.set_data(data)
1147126
def filter_keys(self, **kwargs):
        ""
        self._used_index = False
        keys = set(self.data.keys())
        for key_filter, v_filter in kwargs.items():
            if key_filter in self.indexes:
                self._used_index = True
                if v_filter not in self.indexes[key_filter]:
                    keys = set([])
                else:
                    keys = keys.intersection(
                        self.indexes[key_filter][v_filter])
            else:
                keys = keys.intersection(
                    self.simple_filter(key_filter, v_filter))
        return keys
101554
function omit(keys, object){
  var ret = {};

  for (var item in object) {
    ret[item] = object[item];
  }

  for (var i = 0; i < keys.length; i++) {
    delete ret[keys[i]];
  }
  return ret;
}
940705
function removeChildInternals (withoutInternal) {
  return _.chain(withoutInternal)
    .map((item, key) => {
      const withoutInternal = removeInternalValues(item)
      if (withoutInternal !== undefined && withoutInternal !== item) {
        return [key, withoutInternal]
      }
    })
    .filter()
    .fromPairs()
    .value()
}
1106055
def except(*keys)
      self.reject { |k,v| keys.include?(k || k.to_sym) }
    end
544125
public void trim() {
    keys = Arrays.copyOf(keys, size);
    values = Arrays.copyOf(values, size);
    for (MappeableContainer c : values) {
      c.trim();
    }
  }
226469
function detree(items, children, parent_id) {

		var item,
		    i;

		for (i = 0; i < children.length; i++) {

			item = children[i];

			if (parent_id) {
				item.parent = parent_id;
			}

			items.push(item);

			if (item.children) {
				detree(items, item.children, item.id);
			}

			delete item.children;
		}
	}
1204569
def children( record, index, key='refs', stop_types=STOP_TYPES ):
    """"""
    result = []
    for ref in record.get( key,[]):
        try:
            record = index[ref]
        except KeyError, err:
            #print 'No record for %s address %s in %s'%(key, ref, record['address'] )
            pass # happens when an unreachable references a reachable that has been compressed out...
        else:
            if record['type'] not in stop_types:
                result.append(  record  )
    return result
15146
private void removeExistingKeys(Collection<Data> keys) {
        if (keys == null || keys.isEmpty()) {
            return;
        }
        Storage storage = recordStore.getStorage();
        keys.removeIf(storage::containsKey);
    }
603609
def bulk_delete(keys)
      new_entries = nil
      new_children = nil
      new_size = @size

      keys.each do |key|
        index = index_for(key)
        entry = (new_entries || @entries)[index]
        if !entry
          next
        elsif entry[0].eql?(key)
          new_entries ||= @entries.dup
          child = (new_children || @children)[index]
          if child
            # Bring up the first entry from the child into entries
            new_children ||= @children.dup
            new_children[index] = child.delete_at do |child_entry|
              new_entries[index] = child_entry
            end
          else
            new_entries[index] = nil
          end
          new_size -= 1
        else
          child = (new_children || @children)[index]
          if child
            copy = child.find_and_delete(key)
            unless copy.equal?(child)
              new_children ||= @children.dup
              new_children[index] = copy
              new_size -= (child.size - copy_size(copy))
            end
          end
        end
      end

      if new_entries || new_children
        Trie.new(@significant_bits, new_size, new_entries || @entries, new_children || @children)
      else
        self
      end
    end