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 write(self, message):
      cleaned = replace_cr_with_newline(message)
  
      if self.file_friendly_terminal_output:
          self.terminal.write(cleaned)
      else:
          self.terminal.write(message)
  
      self.log.write(cleaned)
  
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 2 for calling the TeeLogger obj's underlying member method code with example usage: obj.write(message) without return types