

def get_ratelimitable_key_tuples(self, req, account_name, container_name=None, obj_name=None, global_ratelimit=None):
    '\n        Returns a list of key (used in memcache), ratelimit tuples. Keys\n        should be checked in order.\n\n        :param req: swob request\n        :param account_name: account name from path\n        :param container_name: container name from path\n        :param obj_name: object name from path\n        :param global_ratelimit: this account has an account wide\n                                 ratelimit on all writes combined\n        '
    keys = []
    if (self.account_ratelimit and account_name and container_name and (not obj_name) and (req.method in ('PUT', 'DELETE'))):
        keys.append((('ratelimit/%s' % account_name), self.account_ratelimit))
    if (account_name and container_name and obj_name and (req.method in ('PUT', 'DELETE', 'POST', 'COPY'))):
        container_size = self.get_container_size(req.environ)
        container_rate = get_maxrate(self.container_ratelimits, container_size)
        if keys:
            keys.append((('ratelimit/%s/%s' % (account_name, container_name)), container_rate))
    if (account_name and container_name and (not obj_name) and (req.method == 'GET')):
        container_size = self.get_container_size(req.environ)
        container_rate = get_maxrate(self.container_listing_ratelimits, container_size)
        if container_rate:
            keys.append((('ratelimit_listing/%s/%s' % (account_name, container_name)), container_rate))
    if (account_name and (req.method in ('PUT', 'DELETE', 'POST', 'COPY'))):
        if global_ratelimit:
            try:
                global_ratelimit = float(global_ratelimit)
                if (global_ratelimit > 0):
                    keys.append((('ratelimit/global-write/%s' % account_name), global_ratelimit))
            except ValueError:
                pass
    return keys

dataset/ETHPy150Open openstack/swift/swift/common/middleware/ratelimit.py RateLimitMiddleware.get_ratelimitable_key_tuples/VarMisuse@131/346 `container_rate`->`keys`