code: def write(self, message):
      file_friendly_message: Optional[str] = None
      if common_logging.FILE_FRIENDLY_LOGGING:
          file_friendly_message = replace_cr_with_newline(message)
          if file_friendly_message.strip():
              sys.stderr.write(file_friendly_message)
      else:
          sys.stderr.write(message)
  
      # Every 10 seconds we also log the message.
      now = time()
      if (
          now - self.last_message_written_time >= 10
          or "100%" in message
      ):
          if file_friendly_message is None:
              file_friendly_message = replace_cr_with_newline(message)
          for message in file_friendly_message.split("\n"):
              message = message.strip()
              if len(message) > 0:
                  logger.info(message)
                  self.last_message_written_time = now
  
file_path: allennlp/allennlp/common/tqdm.py
imports: import logging
  from allennlp.common import logging
  import sys
  from time import time
  from typing import Optional
label_desc: Use image node_id 2 for calling the TqdmToLogsWriter obj's underlying member method code with example usage: obj.write(message) without return types