Remove empty keys from this object. Should always be called after the result is final.
        :return:
434374
def cleanup(self):
        
        empty_keys = [k for k, v in self.items() if not v]

        for k in empty_keys:
            del self[k]
856944
public void clear() {
        Random r = new Random();
        if (privateKeyAsSeed != null) {
            for (int i=0; i< privateKeyAsSeed.length ; i++) {
                privateKeyAsSeed[i] = (char)(r.nextInt(26) + 'a');
            }
            Arrays.fill(privateKeyAsSeed, '\0');
        }
        if (publicKey != null) {
            for (int i=0; i< publicKey.length ; i++) {
                publicKey[i] = (char)(r.nextInt(26) + 'a');
            }
            Arrays.fill(publicKey, '\0');
        }
    }
290745
public void clear()
  {
    _nullValue = NULL;
    
    for (int i = 0; i < _values.length; i++) {
      _keys[i] = null;
      _flags[i] = 0;
      _values[i] = 0;
    }
    
    _size = 0;
  }
219360
def rm_blanks(self):
        
        _blanks = [k for k in self._dict.keys() if not self._dict[k]]
        for key in _blanks:
            del self._dict[key]
1245587
def clear(self, pat=None):
        
        if pat is None:
            return self.__dict__.clear()

        expr = re.compile(fnmatch.translate(pat))
        for key in tuple(self.keys()):
            #make sure the key is a str first
            if isinstance(key, string_types):
                if expr.match(key):
                    del self.__dict__[key]
663689
def cleanup(self):
        
        remove = []
        for handle, assoc in self.assocs.iteritems():
            if assoc.getExpiresIn() == 0:
                remove.append(handle)
        for handle in remove:
            del self.assocs[handle]
        return len(remove), len(self.assocs)
1037427
def _cleanup_keys_with_confirmation(self, keys_to_delete):
    
    print('Round name: ', self.round_name)
    print('Number of entities to be deleted: ', len(keys_to_delete))
    if not keys_to_delete:
      return
    if self.verbose:
      print('Entities to delete:')
      idx = 0
      prev_key_prefix = None
      dots_printed_after_same_prefix = False
      for k in keys_to_delete:
        if idx >= 20:
          print('   ...')
          print('   ...')
          break
        key_prefix = (k.flat_path[0:1]
                      if k.flat_path[0] in [u'SubmissionType', u'WorkType']
                      else k.flat_path[0])
        if prev_key_prefix == key_prefix:
          if not dots_printed_after_same_prefix:
            print('   ...')
          dots_printed_after_same_prefix = True
        else:
          print('  ', k)
          dots_printed_after_same_prefix = False
          idx += 1
        prev_key_prefix = key_prefix
    print()
    inp = input_str('Are you sure? (type "yes" without quotes to confirm): ')
    if inp != 'yes':
      return
    with self.datastore_client.no_transact_batch() as batch:
      for k in keys_to_delete:
        batch.delete(k)
    print('Data deleted')
239430
def clear(self):
        """"""    
        self.sam |= KEY_WRITE
        for v in list(self.values()):
            del self[v.name]
        for k in list(self.subkeys()):
            self.del_subkey(k.name)
638477
public int clearAutoValues() {
        int count = 0;
        Iterator<Map.Entry<String, String>> it = entrySet().iterator();
        while (it.hasNext()) {
            String key = it.next().getKey();
            if (key.charAt(0) == '#' && key.charAt(key.length()-1) == '#') {
                it.remove();
                ++count;
            }
        }
        return count;
    }
261782
def dictlist_wipe_key(dict_list: Iterable[Dict], key: str) -> None:
    
    for d in dict_list:
        d.pop(key, None)
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;
}
483589
def clear(self):
        
        all_keys = self._find_keys_raw(settings.THUMBNAIL_KEY_PREFIX)
        if all_keys:
            self._delete_raw(*all_keys)
860196
def clear(self):
        """"""
        for k in list(self.keys()):
            if k not in self.extrakeys:
                del self[k]
503138
def _prune(self):
        """"""
        delkeys = [k for k in self.keys() if k not in self.__ringbuffer]
        for k in delkeys:  # necessary because dict is changed during iterations
            super(KRingbuffer,self).__delitem__(k)
1026391
def _clean_empty(d):
    """"""
    if not isinstance(d, (dict, list)):
        return d
    if isinstance(d, list):
        return [v for v in (_clean_empty(v) for v in d) if v is not None]
    return {
        k: v for k, v in
        ((k, _clean_empty(v)) for k, v in d.items())
        if v is not None
    }
962412
def clean_dictkeys(ddict, exclusions=None):
    
    exclusions = [] if exclusions is None else exclusions

    if not isinstance(ddict, dict):
        return {}

    for key in list(ddict.keys()):
        if [incl for incl in exclusions if incl in key]:
            data = ddict.pop(key)
            clean_key = exclude_chars(key, exclusions)

            if clean_key:
                if clean_key in ddict:
                    ddict[clean_key] = force_list(ddict[clean_key])
                    add_element(ddict, clean_key, data)
                else:
                    ddict[clean_key] = data

        # dict case
        if isinstance(ddict.get(key), dict):
            ddict[key] = clean_dictkeys(ddict[key], exclusions)

        # list case
        elif isinstance(ddict.get(key), list):
            for row in ddict[key]:
                if isinstance(row, dict):
                    row = clean_dictkeys(row, exclusions)

    return ddict
671638
public function clean() : void
    {
        foreach ($this->retrieveAllKeys() as $k) {
            $this->remove((string)$k);
        }
    }