code: def _tempdir():
      temp_dir = tempfile.mkdtemp()
      try:
          yield temp_dir
      finally:
          shutil.rmtree(temp_dir, ignore_errors=True)
  
imports: import contextlib
  import os
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import List, Set
  import cupy_builder
  import cupy_builder.install_utils
  from cupy_builder import _environment
  from cupy_builder._context import Context
label_desc: Use image node_id 1 for calling a global function with example usage: _tempdir() without return types