code: def error_for(response):
      
      klass = error_classes.get(response.status)
      if klass is None:
          if 400 <= response.status < 500:
              klass = ClientError
          if 500 <= response.status < 600:
              klass = ServerError  # pragma: no cover
      return klass(response)
docs: Return the appropriate initialized exception class for a response.