class_docstr: The user-facing class that provides metric storage functionalities.
  
  In the future we may add support for storing / logging other types of data if needed.
docstr: Similar to :meth:`latest`, but the returned values
  are either the un-smoothed original latest value,
  or a median of the given window_size,
  depend on whether the smoothing_hint is True.
  
  This provides a default behavior that other writers can use.
  
  Note: All scalars saved in the past `window_size` iterations are used for smoothing.
  This is different from the `window_size` definition in HistoryBuffer.
  Use :meth:`get_history_window_size` to get the `window_size` used in HistoryBuffer.
docstr_tok: ["Similar","to",":","meth",":","`","latest","`",",","but","the","returned","values","are","either","the","un-smoothed","original","latest","value",",","or","a","median","of","the","given","window_size",",","depend","on","whether","the","smoothing_hint","is","True",".","This","provides","a","default","behavior","that","other","writers","can","use",".","Note",":","All","scalars","saved","in","the","past","`","window_size","`","iterations","are","used","for","smoothing",".","This","is","different","from","the","`","window_size","`","definition","in","HistoryBuffer",".","Use",":","meth",":","`","get_history_window_size","`","to","get","the","`","window_size","`","used","in","HistoryBuffer","."]
code: def latest_with_smoothing_hint(self, window_size=20):
      """
      Similar to :meth:`latest`, but the returned values
      are either the un-smoothed original latest value,
      or a median of the given window_size,
      depend on whether the smoothing_hint is True.
  
      This provides a default behavior that other writers can use.
  
      Note: All scalars saved in the past `window_size` iterations are used for smoothing.
      This is different from the `window_size` definition in HistoryBuffer.
      Use :meth:`get_history_window_size` to get the `window_size` used in HistoryBuffer.
      """
      result = {}
      for k, (v, itr) in self._latest_scalars.items():
          result[k] = (
              self._history[k].median(
                  self.count_samples(k, window_size)
              )
              if self._smoothing_hints[k]
              else v,
              itr,
          )
      return result
  
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 9 for calling the EventStorage obj's underlying member method code with example usage: obj.latest_with_smoothing_hint(window_size) and returns: result