'Decrements an existing key by 1. If Key\'s value is 1, remove it from the data structure.
:type key: str
:rtype: void'

def dec(self, key):

    if (key not in self.bucket_of_key):
        return
    (bucket, prev_bucket) = (self.bucket_of_key[key], self.bucket_of_key[key].prev)
    self.bucket_of_key.pop(key, None)
    if (bucket.value > 1):
        if ((bucket is self.buckets.begin()) or (prev_bucket.value < (bucket.value - 1))):
            prev_bucket = self.buckets.insert(bucket, Node((bucket.value - 1), set()))
        prev_bucket.keys.add(key)
        self.bucket_of_key[key] = prev_bucket
    bucket.keys.remove(key)
    if (not bucket.keys):
        self.buckets.erase(bucket)
