code: def set_mock_cluster_info(
      container_addrs: List[str],
      container_rank: int,
      num_slots: int,
      latest_checkpoint: Optional[str] = None,
  ) -> Iterator[det.ClusterInfo]:
      old_info = det._info._info
      info = make_mock_cluster_info(
          container_addrs, container_rank, num_slots, latest_checkpoint
      )
      det._info._info = info
      try:
          yield info
      finally:
          det._info._info = old_info
  
file_path: determined/harness/tests/launch/test_util.py
imports: import contextlib
  import io
  import os
  import sys
  from typing import Callable, Dict, Iterator, List, Optional
  import determined
  from tests.experiment import utils
label_desc: Use image node_id 2 for calling a global function with example usage: set_mock_cluster_info(container_addrs, container_rank, num_slots, latest_checkpoint) without return types