def METHOD_NAME(self):
    if (
        status.HTTP_400_BAD_REQUEST
        <= self.status_code
        <= status.HTTP_511_NETWORK_AUTHENTICATION_REQUIRED
    ):
        raise HTTPError("", response=self)