code: def tempdir_as_cwd():
      with tempdir() as tmp:
          with save_cwd():
              os.chdir(str(tmp))
              yield tmp
  
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 3 for calling a global function with example usage: tempdir_as_cwd() without return types