code: def handle_exception(code, details):
      if code == "DOES_NOT_EXIST":
          return exceptions.DoesNotExist(details)
      if code == "READ_ERROR":
          return exceptions.ReadError(details)
      if code == "WRITE_ERROR":
          return exceptions.WriteError(details)
      if code == "REPOSITORY_CONFIGURATION_ERROR":
          return exceptions.RepositoryConfigurationError(details)
      if code == "INCOMPATIBLE_REPOSITORY_VERSION":
          return exceptions.IncompatibleRepositoryVersion(details)
      if code == "CORRUPTED_REPOSITORY_SPEC":
          return exceptions.CorruptedRepositorySpec(details)
      if code == "CONFIG_NOT_FOUND":
          return exceptions.ConfigNotFound(details)
  
imports: import functools
  import tempfile
  import os
  from typing import Optional, Dict, Any, List
  import subprocess
  import atexit
  import sys
  import threading
  import grpc
  from google.rpc import status_pb2, error_details_pb2
  from .servicepb.keepsake_pb2_grpc import DaemonStub
  from .servicepb import keepsake_pb2
  from .None import pb_convert
  from .experiment import Experiment
  from .checkpoint import Checkpoint, PrimaryMetric
  from .None import exceptions
  from .None import console
label_desc: Use image node_id 2 for calling a global function with example usage: handle_exception(code, details) and returns: exceptions, exceptions, exceptions, exceptions, exceptions, exceptions, exceptions