

def __init__(self, app, conf, logger=None):
    self.app = app
    self.logger = (logger or get_logger(conf, log_route='ratelimit'))
    self.memcache_client = None
    self.account_ratelimit = float(conf.get('account_ratelimit', 0))
    self.max_sleep_time_seconds = float(conf.get('max_sleep_time_seconds', 60))
    self.log_sleep_time_seconds = float(conf.get('log_sleep_time_seconds', 0))
    self.clock_accuracy = int(conf.get('clock_accuracy', 1000))
    self.rate_buffer_seconds = int(conf.get('rate_buffer_seconds', 5))
    self.ratelimit_whitelist = [acc.strip() for acc in conf.get('account_whitelist', '').split(',') if acc.strip()]
    self.ratelimit_blacklist = [acc.strip() for acc in conf.get('account_blacklist', '').split(',') if acc.strip()]
    self.container_ratelimits = interpret_conf_limits(conf, 'container_ratelimit_')
    self.container_listing_ratelimits = interpret_conf_limits(conf, 'container_listing_ratelimit_')

dataset/ETHPy150Open openstack/swift/swift/common/middleware/ratelimit.py RateLimitMiddleware.__init__/original