'Returns a list of key (used in memcache), ratelimit tuples. Keys
should be checked in order.
:param req: swob request
:param account_name: account name from path
:param container_name: container name from path
:param obj_name: object name from path
:param global_ratelimit: this account has an account wide
ratelimit on all writes combined'

def get_ratelimitable_key_tuples(self, req, account_name, container_name=None, obj_name=None, global_ratelimit=None):

    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 container_rate:
            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
