Implement a token bucket rate limiter for a Luxoft API endpoint. Each user has an independent bucket that refills over time and allows a request only when at least one token is available.
Write allow_request(limiters, user_id, timestamp, capacity, refill_rate):
limiters is a mutable dictionary storing per-user bucket state. It may initially be empty.user_id is a hashable identifier.timestamp is a non-negative number of seconds. Calls for the same user are provided in non-decreasing timestamp order.capacity is the maximum number of tokens in each bucket.refill_rate is the number of tokens added per second.True when the request is accepted, otherwise return False.The function should use constant additional work per request, excluding dictionary resizing.
def allow_request(limiters, user_id, timestamp, capacity, refill_rate):