def add_ratelimit_rule(range_seconds, num_requests):
 global rules
 rules.append((range_seconds, num_requests))
 rules.sort(key=(lambda x: x[0]))

def add_ratelimit_rule ( range_seconds , num_requests ) : global rules rules . append ( ( range_seconds , num_requests ) ) rules . sort ( key = ( lambda x : x [ 0 ] ) )
add a rate-limiting rule to the ratelimiter .