Company: GP_10sep
Difficulty: medium
Rate Limiter Using Token Bucket Algorithm Problem Description Implement a rate limiter using the Token Bucket algorithm. The rate limiter controls how many requests a user can make within a time period. The Token Bucket algorithm works as follows: The user has a bucket that holds tokens. Tokens are added to the bucket at a fixed rate. Each request requires one token. If a token is available, the request is allowed. If no token is available, the request is denied. Complete the TokenBucket class: Constructor TokenBucket(bucket_size, refill_rate, starting_time) : bucket_size is the maximum number of tokens the bucket can hold (an integer), refill_rate is the number of tokens added per second (a real number), and starting_time is the moment from which tokens start being added (a real number, in seconds). Method allow_request(current_time) : handles one request made at time current_time (a real number, in seconds) and returns True if the request is allowed or False if it is denied. The buck