code: def handle_neptune_http_errors(
      response, exception: Optional[HTTPError] = None
  ):
      from neptune.management.exceptions import (
          ActiveProjectsLimitReachedException,
          IncorrectIdentifierException,
          ObjectNotFound,
          ProjectKeyCollision,
          ProjectKeyInvalid,
          ProjectNameCollision,
          ProjectNameInvalid,
          ProjectPrivacyRestrictedException,
          ProjectsLimitReached,
      )
  
      error_processors: Dict[str, Callable[[Dict], Exception]] = {
          "ATTRIBUTES_PER_EXPERIMENT_LIMIT_EXCEEDED": lambda response_body: NeptuneFieldCountLimitExceedException(
              limit=response_body.get("limit", "<unknown limit>"),
              container_type=response_body.get(
                  "experimentType", "object"
              ),
              identifier=response_body.get(
                  "experimentQualifiedName", "<unknown identifier>"
              ),
          ),
          "AUTHORIZATION_TOKEN_EXPIRED": lambda _: NeptuneAuthTokenExpired(),
          "EXPERIMENT_NOT_FOUND": lambda _: ObjectNotFound(),
          "INCORRECT_IDENTIFIER": lambda response_body: IncorrectIdentifierException(
              identifier=response_body.get(
                  "identifier", "<Unknown identifier>"
              )
          ),
          "LIMIT_OF_PROJECTS_REACHED": lambda _: ProjectsLimitReached(),
          "PROJECT_KEY_COLLISION": lambda response_body: ProjectKeyCollision(
              key=response_body.get("key", "<unknown key>")
          ),
          "PROJECT_KEY_INVALID": lambda response_body: ProjectKeyInvalid(
              key=response_body.get("key", "<unknown key>"),
              reason=response_body.get("reason", "Unknown reason"),
          ),
          "PROJECT_NAME_COLLISION": lambda response_body: ProjectNameCollision(
              key=response_body.get("key", "<unknown key>")
          ),
          "PROJECT_NAME_INVALID": lambda response_body: ProjectNameInvalid(
              name=response_body.get("name", "<unknown name>")
          ),
          "VISIBILITY_RESTRICTED": lambda response_body: ProjectPrivacyRestrictedException(
              requested=response_body.get("requestedValue"),
              allowed=response_body.get("allowedValues"),
          ),
          "WORKSPACE_IN_READ_ONLY_MODE": lambda response_body: NeptuneLimitExceedException(
              reason=response_body.get("title", "Unknown reason")
          ),
          "PROJECT_LIMITS_EXCEEDED": lambda response_body: NeptuneLimitExceedException(
              reason=response_body.get("title", "Unknown reason")
          ),
          "LIMIT_OF_ACTIVE_PROJECTS_REACHED": lambda response_body: ActiveProjectsLimitReachedException(
              currentQuota=response_body.get(
                  "currentQuota", "<unknown quota>"
              )
          ),
          "WRITE_ACCESS_DENIED_TO_ARCHIVED_PROJECT": lambda _: WritingToArchivedProjectException(),
      }
  
      body = ensure_json_response(response)
      error_type: Optional[str] = body.get("errorType")
      error_processor = error_processors.get(error_type)
      if error_processor:
          if exception:
              raise error_processor(body) from exception
          raise error_processor(body)
  
      if exception:
          raise exception
  
imports: from collections.abc import Callable
  from typing import Dict, Optional
  from bravado.client import SwaggerClient
  from bravado.exception import HTTPError
  from neptune.api.requests_utils import ensure_json_response
  from neptune.common.exceptions import NeptuneAuthTokenExpired, WritingToArchivedProjectException
  from neptune.exceptions import NeptuneFieldCountLimitExceedException, NeptuneLimitExceedException
label_desc: Use image node_id 2 for calling the ApiMethodWrapper obj's underlying member method code with example usage: obj.handle_neptune_http_errors(response, exception) without return types