def make_api_request(http, http_request, retries=7, redirections=_REDIRECTIONS):
 retry = 0
 while True:
  try:
   return _make_api_request_no_retry(http, http_request, redirections=redirections)
  except _RETRYABLE_EXCEPTIONS as exc:
   retry += 1
   if (retry >= retries):
    raise
   retry_after = getattr(exc, 'retry_after', None)
   if (retry_after is None):
    retry_after = calculate_wait_for_retry(retry)
   _reset_http_connections(http)
   logging.debug('Retrying request to url %s after exception %s', http_request.url, type(exc).__name__)
   time.sleep(retry_after)

def make_api_request ( http , http_request , retries = 7 , redirections = _REDIRECTIONS ) : retry = 0 while True : try : return _make_api_request_no_retry ( http , http_request , redirections = redirections ) except _RETRYABLE_EXCEPTIONS as exc : retry += 1 if ( retry >= retries ) : raise retry_after = getattr ( exc , 'retry_after' , None ) if ( retry_after is None ) : retry_after = calculate_wait_for_retry ( retry ) _reset_http_connections ( http ) logging . debug ( 'Retrying request to url %s after exception %s' , http_request . url , type ( exc ) . __name__ ) time . sleep ( retry_after )
send an http request via the given http .