code: def _get_storage_manager(
      checkpoint_storage: Optional[Union[str, Dict[str, Any]]]
  ) -> Optional[storage.StorageManager]:
      if checkpoint_storage is None:
          return None
      if isinstance(checkpoint_storage, str):
          return storage.from_string(checkpoint_storage)
      if isinstance(checkpoint_storage, dict):
          if checkpoint_storage["type"] == "shared_fs":
              raise ValueError(
                  "Cannot configure a shared_fs checkpoint storage with a "
                  "dictionary. Use a string or a configuration file."
              )
          return storage.build(checkpoint_storage, container_path=None)
      raise TypeError(
          "checkpoint_storage must be a string, dictionary, or None"
      )
  
imports: import logging
  import pathlib
  import signal
  import sys
  import threading
  import traceback
  import types
  from typing import Any, Dict, Optional, Union
  import appdirs
  import determined
  from determined import core, tensorboard
  from determined.common import api, constants, storage, util
  from determined.common.api import certs
label_desc: Use image node_id 2 for calling a global function with example usage: _get_storage_manager(checkpoint_storage) and returns: None, storage, storage