class_docstr: This class is an attempt to maintain logs of both stdout and stderr for when models are run.
  To use this class, at the beginning of your script insert these lines::
  
      sys.stdout = TeeLogger("stdout.log", sys.stdout)
      sys.stderr = TeeLogger("stdout.log", sys.stderr)
code: def __init__(self, filename, terminal, file_friendly_terminal_output):
      self.terminal = terminal
      self.file_friendly_terminal_output = file_friendly_terminal_output
      parent_directory = os.path.dirname(filename)
      os.makedirs(parent_directory, exist_ok=True)
      self.log = open(filename, "a")
  
file_path: magnitude/pymagnitude/third_party/allennlp/common/tee_logger.py
imports: from __future__ import absolute_import
  import os
  from io import open
label_desc: Use image node_id 1 to create a new TeeLogger object from inherited base classes: object with example: obj = TeeLogger(filename, terminal, file_friendly_terminal_output)