'Check if one or more tokens can be consumed.
Returns:
bool: true if the number of tokens can be consumed
from the bucket.  If they can be consumed, a call will also
consume the requested number of tokens from the bucket.
Calls will only consume `tokens` (the number requested)
or zero tokens -- it will never consume a partial number
of tokens.'

def can_consume(self, tokens=1):

    if (tokens <= self._get_tokens()):
        self._tokens -= tokens
        return True
    return False
