code: def chdir(path: Path) -> Iterator:
      old = os.getcwd()
      os.chdir(str(path))
      try:
          yield
      finally:
          os.chdir(old)
  
file_path: determined/harness/tests/filetree.py
imports: import contextlib
  import os
  import shutil
  import tempfile
  from pathlib import Path
  from types import TracebackType
  from typing import ContextManager, Dict, Iterator, Optional, Type, Union
label_desc: Use image node_id 1 for calling a global function with example usage: chdir(path) without return types