code: def throttle(self, key, amount=1, rate=None, capacity=None,
              exc_class=Throttled, **kwargs):
          
  
          if not self.consume(key, amount, rate, capacity, **kwargs):
              raise exc_class("Request of %d unit for %s exceeds capacity."
                      % (amount, key))
docs: Consume an amount for a given key, or raise a Throttled exception.