code: def _full_storage_path(
      host_path: str,
      storage_path: Optional[str] = None,
      container_path: Optional[str] = None,
  ) -> str:
      """
      Return the full path to the storage_path, either as a subdirectory of the host_path in the
      host environment, where container_path must be None, or as a subdirectory of the container_path
      when in the container enviornment, where container_path must not be None.
      """
      check.true(
          os.path.isabs(host_path),
          "`host_path` must be an absolute path.",
      )
  
      if storage_path is None:
          return host_path if container_path is None else container_path
  
      # Note that os.path.join() will just return storage_path when it is absolute.
      abs_path = os.path.normpath(os.path.join(host_path, storage_path))
      check.true(
          abs_path.startswith(host_path),
          "storage path must be a subdirectory of host path.",
      )
      storage_path = os.path.relpath(abs_path, host_path)
  
      return os.path.join(
          host_path if container_path is None else container_path,
          storage_path,
      )
  
imports: import contextlib
  import glob
  import logging
  import os
  import pathlib
  import shutil
  from typing import Any, Callable, Dict, Iterator, List, Optional, Union
  from determined import errors, util
  from determined.common import check, storage
label_desc: Use image node_id 3 for calling a global function with example usage: _full_storage_path(host_path, storage_path, container_path) and returns: os, unknown