delete the key-value pair with the maximum key rooted at h
193084
private Node<T> removeMax(Node<T> h, boolean updateLast) { 
        if (h.left != null && h.left.red)
            h = rotateRight(h);

        if (h.right == null)
            return null;

        if (!h.right.red && (h.right.left == null || !h.right.left.red))
            h = moveRedRight(h);

        h.right = removeMax(h.right, updateLast);
        if (h.right == null && updateLast)
        	last = h;
        return balance(h);
    }
198410
def _trim_dict_in_dict(data, max_val_size, replace_with):
    '''
    
    '''
    for key in data:
        if isinstance(data[key], dict):
            _trim_dict_in_dict(data[key],
                               max_val_size,
                               replace_with)
        else:
            if sys.getsizeof(data[key]) > max_val_size:
                data[key] = replace_with
253198
def update(self, key, value):
        
        if not is_string(key):
            raise Exception("Key must be string")

        # if len(key) > 32:
        #     raise Exception("Max key length is 32")

        if not is_string(value):
            raise Exception("Value must be string")

        # if value == '':
        #     return self.delete(key)
        self.root_node = self._update_and_delete_storage(
            self.root_node,
            bin_to_nibbles(to_string(key)),
            to_string(value))
        self._update_root_hash()
818501
def delete_tree(self, key):
        """"""
        self.log.debug("Deleting tree: %r", key)
        names = [item["name"] for item in self.list_path(key, with_metadata=False, deep=True)]
        for name in names:
            self.delete_key(name)
517737
def remove_by_rank(self, low, high=None):
        
        if high is None:
            high = low
        return self.database.zremrangebyrank(self.key, low, high)
1280206
def delete_max(self):
        

        # Attempt to rotate left-leaning reds to the right.
        if self.left.red:
            self = self.rotate_right()

        # Base case: If there are no selfs greater than this self, then this is
        # the self to delete.
        if self.right is NULL:
            return NULL, self.value

        # Acquire more reds if necessary to continue the traversal. NULL is
        # red so this check doesn't need to check for NULL.
        if not self.right.red and not self.right.left.red:
            self = self.move_red_right()

        # Recursive case: Delete the maximum self of all selfs greater than this
        # self.
        right, value = self.right.delete_max()
        self = self._replace(right=right)

        return self.balance(), value
21486
def remove(self, key):
        ''''''
        copydict = ImmutableDict()
        copydict.tree = self.tree.remove(hash(key))
        copydict._length = self._length - 1
        return copydict
1236537
public V remove (K key) {
		int hashCode = key.hashCode();
		int index = hashCode & mask;
		if (key.equals(keyTable[index])) {
			keyTable[index] = null;
			V oldValue = valueTable[index];
			valueTable[index] = null;
			size--;
			return oldValue;
		}

		index = hash2(hashCode);
		if (key.equals(keyTable[index])) {
			keyTable[index] = null;
			V oldValue = valueTable[index];
			valueTable[index] = null;
			size--;
			return oldValue;
		}

		index = hash3(hashCode);
		if (key.equals(keyTable[index])) {
			keyTable[index] = null;
			V oldValue = valueTable[index];
			valueTable[index] = null;
			size--;
			return oldValue;
		}

		if (bigTable) {
			index = hash4(hashCode);
			if (key.equals(keyTable[index])) {
				keyTable[index] = null;
				V oldValue = valueTable[index];
				valueTable[index] = null;
				size--;
				return oldValue;
			}
		}

		return removeStash(key);
	}
873551
def pop_max(self):
        

        if self.root is NULL:
            raise KeyError("pop from an empty blackjack")

        self.root, value = self.root.delete_max()
        self._len -= 1
        return value
301528
private boolean removeMapping(Object key, Object value) {
        Object k = maskNull(key);
        Object[] tab = table;
        int len = tab.length;
        int i = hash(k, len);

        while (true) {
            Object item = tab[i];
            if (item == k) {
                if (tab[i + 1] != value)
                    return false;
                modCount++;
                size--;
                tab[i] = null;
                tab[i + 1] = null;
                closeDeletion(i);
                return true;
            }
            if (item == null)
                return false;
            i = nextKeyIndex(i, len);
        }
    }
493402
def _pop(self, key, default=None):
        
        value = default
        if key in self:
            value = self[key]
            del self[key]
        return value
672339
def Pop(self, key):
    """"""
    node = self._hash.get(key)

    if node:
      del self._hash[key]
      self._age.Unlink(node)

      return node.data
1199622
def remove_hash_prefix_indices(self, threat_list, indices):
        """"""
        batch_size = 40
        q = '''DELETE FROM hash_prefix
                WHERE threat_type=? AND platform_type=? AND threat_entry_type=? AND value IN ({})
        '''
        prefixes_to_remove = self.get_hash_prefix_values_to_remove(threat_list, indices)
        with self.get_cursor() as dbc:
            for i in range(0, len(prefixes_to_remove), batch_size):
                remove_batch = prefixes_to_remove[i:(i + batch_size)]
                params = [
                    threat_list.threat_type,
                    threat_list.platform_type,
                    threat_list.threat_entry_type
                ] + [sqlite3.Binary(b) for b in remove_batch]
                dbc.execute(q.format(','.join(['?'] * len(remove_batch))), params)
578390
def cleanup_key(name):
    
    name = name.lstrip('+')
    is_keypad = name.startswith('KP_')
    for mod in ('Meta_', 'Control_', 'dead_', 'KP_'):
        if name.startswith(mod):
            name = name[len(mod):]

    # Dumpkeys is weird like that.
    if name == 'Remove':
        name = 'Delete'
    elif name == 'Delete':
        name = 'Backspace'

    if name.endswith('_r'):
        name = 'right ' + name[:-2]
    if name.endswith('_l'):
        name = 'left ' + name[:-2]


    return normalize_name(name), is_keypad
415142
def shrink (self):
        """"""
        trim = int(0.05*len(self))
        if trim:
            items = super(LFUCache, self).items()
            # sorting function for items
            keyfunc = lambda x: x[1][0]
            values = sorted(items, key=keyfunc)
            for item in values[0:trim]:
                del self[item[0]]
768930
def _normalize_slice(self, key, clamp=False):
        """"""
        if key.start is None:
            start = 0
        else:
            start = (len(self) + key.start) if key.start < 0 else key.start
        if key.stop is None or key.stop == maxsize:
            stop = len(self) if clamp else None
        else:
            stop = (len(self) + key.stop) if key.stop < 0 else key.stop
        return slice(start, stop, key.step or 1)
246890
function Delete()
    {
        if ($this->KeyValue())
        {
            $schema = $this->GetSchema();
            $schema->Delete($this->KeyCondition());
        }
    }