code: def test_tempdir():
      with tempdir() as tmpdir:
          fname = pjoin(tmpdir, "example_file.txt")
          with open(fname, "w") as fobj:
              fobj.write("a string\\n")
      assert_(not exists(tmpdir))
  
imports: from os import getcwd
  from os.path import realpath, abspath, dirname, isfile, join, exists
  from scipy._lib._tmpdirs import tempdir, in_tempdir, in_dir
  from numpy.testing import assert_, assert_equal
label_desc: Use image node_id 1 for calling a global function with example usage: test_tempdir() without return types