code: def handle_response(response):
      
  
      # ignore valid responses
      if response.status_code < 400:
          return
  
      cls = _status_to_exception_type.get(response.status_code, HttpError)
  
      kwargs = {
          'code': response.status_code,
          'method': response.request.method,
          'url': response.request.url,
          'details': response.text,
      }
  
      if response.headers and 'retry-after' in response.headers:
          kwargs['retry_after'] = response.headers.get('retry-after')
  
      raise cls(**kwargs)
docs: Given a requests.Response object, throw the appropriate exception, if applicable.