def temp_output_dir(prefix="tmp", suffix="", dir=None, make_parents=False, always_clean=False):
  """
  A context manager for convenience in creating a temporary directory,
  which is deleted when exiting the context.

  Usage:
    with temp_output_dir() as dirname:
      ...
  """
  return _temp_output(True, prefix=prefix, suffix=suffix, dir=dir, make_parents=make_parents,
                      always_clean=always_clean)