@contextmanager
def temp_output_file(prefix=None, based_on=None, with_nonce=True):
  '''
  A context manager for convenience in using a temporary file, which is deleted when exiting the context.
  '''
  tmp_path = new_temp_filename(prefix=prefix, based_on=based_on, with_nonce=with_nonce)
  yield tmp_path
  try:
    os.remove(tmp_path)
  except __HOLE__, e:
    pass
dataset/ETHPy150Open bloomreach/zinc/zinc.py/temp_output_file