class_docstr: Log statistics writer implementation for the console, mainly for debugging purposes. Creates table-like console
  text in a fixed width layout.
docstr: see LogStatsWriter.write
code: def write(self, path: str, step: int, stats: LogStats) -> None:
      """see LogStatsWriter.write"""
  
      # print run directory
      exp_dir = os.path.abspath(".")
      print("Output directory: {}".format(exp_dir))
  
      # print stats
      print("{0:>5}|{1:<88}|{2:>20}".format("step", "path", "value"))
      print(
          "{0:>5}|{1:<88}|{2:>20}".format("=" * 5, "=" * 88, "=" * 20)
      )
  
      for (event, name, groups), value in stats.items():
          tag = self._event_to_tag(event, name, groups)
  
          if path:
              tag.insert(0, path)
  
          # limit the "tag path" to 4 elements (e.g. train|valid, EventClass, event_method, value/group)
          if len(tag) > 4:
              tag = tag[:3] + ["/".join(tag[3:])]
  
          tag = [self._limit(p, 22) for p in tag]
          for _ in range(4 - len(tag)):
              tag.append("\u00B7" * 22)
  
          # TODO: this should be solved with decorators defining how to log certain stats
          if isinstance(value, List):
              # if tuple is provided extract actual value as the entry at position 0
              if isinstance(value[0], tuple):
                  value = [v[0] for v in value]
              value_str = "[len:{0}, μ:{1:.1f}]".format(
                  len(value), np.mean(value)
              )
              print(
                  "{0:>5}|{1:<88}|{2:>20}".format(
                      step, "".join(tag), value_str
                  )
              )
          else:
              print(
                  "{0:>5}|{1:<88}|{2:>20.3f}".format(
                      step, "".join(tag), value
                  )
              )
  
file_path: maze/maze/core/log_stats/log_stats_writer_console.py
imports: import os
  from typing import Optional, Callable, List
  import numpy
  from maze.core.log_stats.log_stats import LogStatsWriter, LogStats
label_desc: Use image node_id 1 for calling the LogStatsWriterConsole obj's underlying member method code with example usage: obj.write(path, step, stats) without return types