code: def tempdir():
      """Create and return a temporary directory.  This has the same
      behavior as mkdtemp but can be used as a context manager.
  
      Upon exiting the context, the directory and everything contained
      in it are removed.
  
      Examples
      --------
      >>> import os
      >>> with tempdir() as tmpdir:
      ...     fname = os.path.join(tmpdir, 'example_file.txt')
      ...     with open(fname, 'wt') as fobj:
      ...         _ = fobj.write('a string\\n')
      >>> os.path.exists(tmpdir)
      False
      """
      d = mkdtemp()
      yield d
      rmtree(d)
  
file_path: catboost/contrib/python/scipy/py2/scipy/_lib/_tmpdirs.py
imports: from __future__ import division, print_function, absolute_import
  import os
  from contextlib import contextmanager
  from shutil import rmtree
  from tempfile import mkdtemp
label_desc: Use image node_id 1 for calling a global function with example usage: tempdir() without return types