def _check_response(response):
 if (response is None):
  raise RequestError('Request did not return a response.')
 elif ((response.status_code >= 500) or (response.status_code == TOO_MANY_REQUESTS)):
  raise BadStatusCodeError.from_response(response)
 elif response.retry_after:
  raise RetryAfterError.from_response(response)

def _check_response ( response ) : if ( response is None ) : raise RequestError ( 'Request did not return a response.' ) elif ( ( response . status_code >= 500 ) or ( response . status_code == TOO_MANY_REQUESTS ) ) : raise BadStatusCodeError . from_response ( response ) elif response . retry_after : raise RetryAfterError . from_response ( response )
validate a response :type response: :class:response .