def Write(self, filename, file=None):
    """Writes all messages.

    Args:
      filename: Vroom file that was tested, for use in the header.
      file: An alternate file to write to. Will only redirect to the
          alternate file if it was going to write to a file in the first place.
    Returns:
      Whether or not output was written.
    """
    if self._file is None:
      return False
    file = file or self._file
    lines = list(self.Finalize(self._queue))
    self.Print('', file=file)
    if lines:
      if self.HEADER:
        header = self.HEADER % {'filename': filename}
        self.Print(header, end=':\n', file=file)
      for line in lines:
        self.Print(line.rstrip('\n'), file=file)
    elif self.EMPTY:
      empty = self.EMPTY % {'filename': filename}
      self.Print(empty, end='.\n', file=file)
    return True
dataset/ETHPy150Open google/vroom/vroom/output.py/Logger.Write/original