code: def open_tempdir(dir_path):
      Path(dir_path).mkdir(parents=True)
  
      try:
          yield dir_path
      finally:
          shutil.rmtree(dir_path)
  
imports: import os
  import shutil
  from contextlib import contextmanager
  from pathlib import Path
label_desc: Use image node_id 3 for calling a global function with example usage: open_tempdir(dir_path) without return types