class_docstr: Print **common** metrics to the terminal, including
  iteration time, ETA, memory, all losses, and the learning rate.
  It also applies smoothing using a window of 20 elements.
  
  It's meant to print common metrics in common ways.
  To print something in more customized ways, please implement a similar printer by yourself.
code: def _get_eta(self, storage) -> Optional[str]:
      if self._max_iter is None:
          return ""
      iteration = storage.iter
      try:
          eta_seconds = storage.history("time").median(1000) * (
              self._max_iter - iteration - 1
          )
          storage.put_scalar(
              "eta_seconds", eta_seconds, smoothing_hint=False
          )
          return str(datetime.timedelta(seconds=int(eta_seconds)))
      except KeyError:
          # estimate eta on our own - more noisy
          eta_string = None
          if self._last_write is not None:
              estimate_iter_time = (
                  time.perf_counter() - self._last_write[1]
              ) / (iteration - self._last_write[0])
              eta_seconds = estimate_iter_time * (
                  self._max_iter - iteration - 1
              )
              eta_string = str(
                  datetime.timedelta(seconds=int(eta_seconds))
              )
          self._last_write = (iteration, time.perf_counter())
          return eta_string
  
imports: import datetime
  import json
  import logging
  import os
  import time
  from collections import defaultdict
  from contextlib import contextmanager
  from functools import cached_property
  from typing import Optional
  import torch
  from fvcore.common.history_buffer import HistoryBuffer
  from detectron2.utils.file_io import PathManager
label_desc: Use image node_id 2 for calling the CommonMetricPrinter obj's underlying member method code with example usage: obj._get_eta(storage) and returns: str, str, eta_string