

def should_be_throttled(self, identifier, **kwargs):
    '\n        Returns whether or not the user has exceeded their throttle limit.\n        \n        Maintains a list of timestamps when the user accessed the api within\n        the cache.\n        \n        Returns ``False`` if the user should NOT be throttled or ``True`` if\n        the user should be throttled.\n        '
    key = self.convert_identifier_to_key(identifier)
    cache.add(key, [])
    minimum_time = (int(time.time()) - int(self.timeframe))
    times_accessed = [access for access in cache.get(key) if (access >= minimum_time)]
    cache.set(key, times_accessed, self.expiration)
    if (len(times_accessed) >= int(self.throttle_at)):
        return True
    return False

dataset/ETHPy150Open hzlf/openbroadcast/website/apps/tastypie/throttle.py CacheThrottle.should_be_throttled/original