code: def get_api_error(response):
    
    error_class = _status_code_to_class.get(response.status_code, APIError)
    return error_class(response)
docs: Acquires the correct error for a given response.
  
    :param requests.Response response: HTTP error response
    :returns: the appropriate error for a given response
    :rtype: APIError