code: def tempdir():
      tmpdir = tempfile.mkdtemp()
      try:
          yield pathlib.Path(tmpdir)
      finally:
          shutil.rmtree(tmpdir)
  
imports: import os
  import sys
  import copy
  import json
  import shutil
  import pathlib
  import tempfile
  import textwrap
  import functools
  import contextlib
  from test.support.os_helper import FS_NONASCII
  from test.support import requires_zlib
  from .None import _path
  from ._path import FilesSpec
label_desc: Use image node_id 1 for calling a global function with example usage: tempdir() without return types