code: def tempdir():
      dirpath = tempfile.mkdtemp()
      try:
          yield dirpath
      finally:
          shutil.rmtree(dirpath)
  
imports: import contextlib
  import multiprocessing
  import os
  import shutil
  import sys
  import tempfile
  import time
  import traceback
  import cloudpickle
  import mock
  from horovod.runner.util.threads import in_thread
label_desc: Use image node_id 5 for calling a global function with example usage: tempdir() without return types