code: def chdir(path):
      # A context manager that changes the current directory temporarily.
  
      old_chdir = os.getcwd()
      os.chdir(path)
      try:
          yield
      finally:
          os.chdir(old_chdir)
  
imports: import contextlib
  import os
  import re
  import shutil
  import subprocess
  import sys
  import tempfile
label_desc: Use image node_id 2 for calling a global function with example usage: chdir(path) without return types