code: def tempdir(**kwargs):
      # A context manager that defines a lifetime of a temporary directory.
  
      temp_dir = tempfile.mkdtemp(**kwargs)
      try:
          yield temp_dir
      finally:
          shutil.rmtree(temp_dir)
  
imports: import contextlib
  import os
  import re
  import shutil
  import subprocess
  import sys
  import tempfile
label_desc: Use image node_id 1 for calling a global function with example usage: tempdir() without return types