<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def throttle(self, key, amount=1, rate=None, capacity=None, exc_class=Throttled, **kwargs):
 """Consume an amount for a given key, or raise a Throttled exception."""


        if not self.consume(key, amount, rate, capacity, **kwargs):
            raise exc_class("Request of %d unit for %s exceeds capacity."
                    % (amount, key))