code: def get_temp_file (mode='r', **kwargs):
      
      fd, filename = tempfile.mkstemp(**kwargs)
      return os.fdopen(fd, mode), filename
docs: Return tuple (open file object, filename) pointing to a temporary
      file.