code: def make_mock_storage_manager(basedir: pathlib.Path) -> Any:
      @contextlib.contextmanager
      def store_path(dst: str) -> Iterator[pathlib.Path]:
          path = basedir.joinpath("store-path")
          path.mkdir(exist_ok=True)
          yield pathlib.Path(path)
  
      @contextlib.contextmanager
      def restore_path(
          storage_id: str,
          selector: Optional[Callable[[str], bool]] = None,
      ) -> Iterator[pathlib.Path]:
          path = basedir.joinpath("restore-path")
          path.mkdir(exist_ok=True)
          yield pathlib.Path(path)
  
      storage_manager = mock.MagicMock()
      storage_manager.store_path = mock.MagicMock(
          side_effect=store_path
      )
      storage_manager.restore_path = mock.MagicMock(
          side_effect=restore_path
      )
      storage_manager._list_directory = mock.MagicMock(
          return_value={"one": 1, "two": 2}
      )
  
      return storage_manager
  
file_path: determined/harness/tests/core/test_checkpoint.py
imports: import contextlib
  import pathlib
  from typing import Any, Callable, Dict, Iterator, List, Optional
  from unittest import mock
  import pytest
  import requests
  from determined import core
  from tests import parallel
label_desc: Use image node_id 1 for calling a global function with example usage: make_mock_storage_manager(basedir) and returns: storage_manager