Write code that performs rate limiting for a user. Criteria: one attempt/user/sec; 4 attempts/user/3 sec.
Implement rate_limit_attempts(attempts), where attempts is a chronologically ordered list of (user_id, timestamp) pairs. Return a Boolean for each attempt indicating whether it is accepted. Use sliding windows, count accepted attempts, and treat window boundaries as exclusive on the left. Timestamps are numeric seconds and may be fractional.
def rate_limit_attempts(attempts):