code: def create_tempdir(suffix='', prefix='tmp', directory=None, delete=True):
      
      tempd = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=directory)
      if delete:
          atexit.register(_cleanup_tempdir, tempd)
      return tempd
docs: Create a tempdir and return the path.
  
      This function registers the new temporary directory
      for deletion with the atexit module.