code: def build(
      config: Dict[str, Any], container_path: Optional[str]
  ) -> StorageManager:
      """
      Return a checkpoint manager defined by the value of the `type` key in
      the configuration dictionary. Throws a `TypeError` if no storage manager
      with `type` is defined.
      """
      if "type" not in config:
          raise ValueError(
              "Missing 'type' parameter of storage configuration"
          )
  
      # Make a deep copy of the config because we are removing items to
      # pass to the constructor of the `StorageManager`.
      config = copy.deepcopy(config)
      identifier = config.pop("type")
      if not isinstance(identifier, str):
          raise ValueError(
              "`type` parameter of storage configuration must be a string"
          )
  
      try:
          subclass = _STORAGE_MANAGERS[identifier]
      except KeyError:
          raise TypeError("Unknown storage type: {}".format(identifier))
  
      # Remove configurations that should not be directly passed to
      # subclasses. Keeping these would result in the subclass __init__()
      # function failing to a TypeError with an unexpected keyword.
      config.pop("save_experiment_best", None)
      config.pop("save_trial_best", None)
      config.pop("save_trial_latest", None)
  
      # For shared_fs maintain backwards compatibility by folding old keys into
      # storage_path.
      if identifier == "shared_fs" and "storage_path" not in config:
          if "tensorboard_path" in config:
              config["storage_path"] = config.get(
                  "tensorboard_path", None
              )
          else:
              config["storage_path"] = config.get(
                  "checkpoint_path", None
              )
      elif identifier == "azure":
          if not (
              "connection_string" in config or "account_url" in config
          ):
              raise ValueError(
                  """At least one of [connection_string, account_url] must be specified for Azure Blob
                   Storage, but none were."""
              )
          if "container" not in config:
              raise ValueError(
                  "Container name must be specified for Azure Blob Storage."
              )
  
      config.pop("tensorboard_path", None)
      config.pop("checkpoint_path", None)
  
      try:
          return subclass.from_config(config, container_path)
      except TypeError as e:
          raise TypeError(
              "Failed to instantiate {} checkpoint storage: {}".format(
                  identifier, str(e)
              )
          )
  
file_path: determined/harness/determined/common/storage/__init__.py
imports: import copy
  import uuid
  from typing import Any, Dict, Optional, Type
  from determined.common.storage.base import StorageManager, Paths, Selector, from_string
  from determined.common.storage.cloud import CloudStorageManager
  from determined.common.storage.azure import AzureStorageManager
  from determined.common.storage.gcs import GCSStorageManager
  from determined.common.storage.s3 import S3StorageManager
  from determined.common.storage.shared import SharedFSStorageManager
  from determined.common.storage.directory import DirectoryStorageManager
label_desc: Use image node_id 1 for calling a global function with example usage: build(config, container_path) and returns: subclass