Implement a thread-safe rate limiter that can handle thousands of concurrent network requests.
Implement a per-key sliding-window limiter. Each request has a key and timestamp, and the limiter must atomically decide whether to accept it while allowing at most limit accepted requests for that key during any window-second interval. The grading contract is rate_limit(requests, limit, window), where requests is an ordered list of [key, timestamp] pairs and the result is a Boolean list. Your implementation must include a reusable thread-safe limiter object internally; timestamps for each key are nondecreasing.
[key, timestamp]t counts requests with timestamps in [t - window, t]def rate_limit(requests, limit, window):