new_contents: from contextlib import contextmanager
  import os
  import shutil
  import tempfile
  
  
  def raises(exc, lamda):
      try:
          lamda()
          return False
      except exc:
          return True
  
  
  @contextmanager
  def tmpfile(extension=''):
      extension = '.' + extension.lstrip('.')
      handle, filename = tempfile.mkstemp(extension)
      os.close(handle)
      os.remove(filename)
  
      try:
          yield filename
      finally:
          if os.path.exists(filename):
              if os.path.isdir(filename):
                  shutil.rmtree(filename)
              else:
                  os.remove(filename)
  
subject: add tmpfile to utils