def set_rate_limit(limit_or_interval=1.0, new_requests=1):
 global limit_interval
 global limit_requests
 global do_rate_limit
 if isinstance(limit_or_interval, bool):
  do_rate_limit = limit_or_interval
 else:
  if (limit_or_interval <= 0.0):
   raise ValueError("limit_or_interval can't be less than 0")
  if (new_requests <= 0):
   raise ValueError("new_requests can't be less than 0")
  do_rate_limit = True
  limit_interval = limit_or_interval
  limit_requests = new_requests

def set_rate_limit ( limit_or_interval = 1.0 , new_requests = 1 ) : global limit_interval global limit_requests global do_rate_limit if isinstance ( limit_or_interval , bool ) : do_rate_limit = limit_or_interval else : if ( limit_or_interval <= 0.0 ) : raise ValueError ( "limit_or_interval can't be less than 0" ) if ( new_requests <= 0 ) : raise ValueError ( "new_requests can't be less than 0" ) do_rate_limit = True limit_interval = limit_or_interval limit_requests = new_requests
sets the rate limiting behavior of the module .