class_docstr: An `EventAccumulator` takes an event generator, and accumulates the
  values.
  
  The `EventAccumulator` is intended to provide a convenient Python interface
  for loading Event data written during a TensorFlow run. TensorFlow writes out
  `Event` protobuf objects, which have a timestamp and step number, and often
  contain a `Summary`. Summaries can have different kinds of data like an image,
  a scalar value, or a histogram. The Summaries also have a tag, which we use to
  organize logically related data. The `EventAccumulator` supports retrieving
  the `Event` and `Summary` data by its tag.
  
  Calling `Tags()` gets a map from `tagType` (e.g. `'images'`,
  `'compressedHistograms'`, `'scalars'`, etc) to the associated tags for those
  data types. Then, various functional endpoints (eg
  `Accumulator.Scalars(tag)`) allow for the retrieval of all data
  associated with that tag.
  
  The `Reload()` method synchronously loads all of the data written so far.
  
  Histograms, audio, and images are very large, so storing all of them is not
  recommended.
  
  Fields:
    audios: A reservoir.Reservoir of audio summaries.
    compressed_histograms: A reservoir.Reservoir of compressed
        histogram summaries.
    histograms: A reservoir.Reservoir of histogram summaries.
    images: A reservoir.Reservoir of image summaries.
    most_recent_step: Step of last Event proto added. This should only
        be accessed from the thread that calls Reload. This is -1 if
        nothing has been loaded yet.
    most_recent_wall_time: Timestamp of last Event proto added. This is
        a float containing seconds from the UNIX epoch, or -1 if
        nothing has been loaded yet. This should only be accessed from
        the thread that calls Reload.
    path: A file path to a directory containing tf events files, or a single
        tf events file. The accumulator will load events from this path.
    scalars: A reservoir.Reservoir of scalar summaries.
    tensors: A reservoir.Reservoir of tensor summaries.
  
  @@Tensors
class_docstr_tok: ["An","`","EventAccumulator","`","takes","an","event","generator",",","and","accumulates","the","values",".","The","`","EventAccumulator","`","is","intended","to","provide","a","convenient","Python","interface","for","loading","Event","data","written","during","a","TensorFlow","run",".","TensorFlow","writes","out","`","Event","`","protobuf","objects",",","which","have","a","timestamp","and","step","number",",","and","often","contain","a","`","Summary","`",".","Summaries","can","have","different","kinds","of","data","like","an","image",",","a","scalar","value",",","or","a","histogram",".","The","Summaries","also","have","a","tag",",","which","we","use","to","organize","logically","related","data",".","The","`","EventAccumulator","`","supports","retrieving","the","`","Event","`","and","`","Summary","`","data","by","its","tag",".","Calling","`","Tags","(",")","`","gets","a","map","from","`","tagType","`","(","e.g",".","`","'images","'","`",",","`","'compressedHistograms","'","`",",","`","'scalars","'","`",",","etc",")","to","the","associated","tags","for","those","data","types",".","Then",",","various","functional","endpoints","(","eg","`","Accumulator.Scalars","(","tag",")","`",")","allow","for","the","retrieval","of","all","data","associated","with","that","tag",".","The","`","Reload","(",")","`","method","synchronously","loads","all","of","the","data","written","so","far",".","Histograms",",","audio",",","and","images","are","very","large",",","so","storing","all","of","them","is","not","recommended",".","Fields",":","audios",":","A","reservoir.Reservoir","of","audio","summaries",".","compressed_histograms",":","A","reservoir.Reservoir","of","compressed","histogram","summaries",".","histograms",":","A","reservoir.Reservoir","of","histogram","summaries",".","images",":","A","reservoir.Reservoir","of","image","summaries",".","most_recent_step",":","Step","of","last","Event","proto","added",".","This","should","only","be","accessed","from","the","thread","that","calls","Reload",".","This","is","-1","if","nothing","has","been","loaded","yet",".","most_recent_wall_time",":","Timestamp","of","last","Event","proto","added",".","This","is","a","float","containing","seconds","from","the","UNIX","epoch",",","or","-1","if","nothing","has","been","loaded","yet",".","This","should","only","be","accessed","from","the","thread","that","calls","Reload",".","path",":","A","file","path","to","a","directory","containing","tf","events","files",",","or","a","single","tf","events","file",".","The","accumulator","will","load","events","from","this","path",".","scalars",":","A","reservoir.Reservoir","of","scalar","summaries",".","tensors",":","A","reservoir.Reservoir","of","tensor","summaries",".","@","@","Tensors"]
docstr: Check and discard expired events using SessionLog.START.
  
  Check for a SessionLog.START event and purge all previously seen events
  with larger steps, because they are out of date. Because of supervisor
  threading, it is possible that this logic will cause the first few event
  messages to be discarded since supervisor threading does not guarantee
  that the START message is deterministically written first.
  
  This method is preferred over _CheckForOutOfOrderStepAndMaybePurge which
  can inadvertently discard events due to supervisor threading.
  
  Args:
    event: The event to use as reference. If the event is a START event, all
      previously seen events with a greater event.step will be purged.
docstr_tok: ["Check","and","discard","expired","events","using","SessionLog.START",".","Check","for","a","SessionLog.START","event","and","purge","all","previously","seen","events","with","larger","steps",",","because","they","are","out","of","date",".","Because","of","supervisor","threading",",","it","is","possible","that","this","logic","will","cause","the","first","few","event","messages","to","be","discarded","since","supervisor","threading","does","not","guarantee","that","the","START","message","is","deterministically","written","first",".","This","method","is","preferred","over","_CheckForOutOfOrderStepAndMaybePurge","which","can","inadvertently","discard","events","due","to","supervisor","threading",".","Args",":","event",":","The","event","to","use","as","reference",".","If","the","event","is","a","START","event",",","all","previously","seen","events","with","a","greater","event.step","will","be","purged","."]
code: def _CheckForRestartAndMaybePurge(self, event):
      """Check and discard expired events using SessionLog.START.
  
      Check for a SessionLog.START event and purge all previously seen events
      with larger steps, because they are out of date. Because of supervisor
      threading, it is possible that this logic will cause the first few event
      messages to be discarded since supervisor threading does not guarantee
      that the START message is deterministically written first.
  
      This method is preferred over _CheckForOutOfOrderStepAndMaybePurge which
      can inadvertently discard events due to supervisor threading.
  
      Args:
        event: The event to use as reference. If the event is a START event, all
          previously seen events with a greater event.step will be purged.
      """
      if (
          event.HasField("session_log")
          and event.session_log.status == event_pb2.SessionLog.START
      ):
          self._Purge(event, by_tags=False)
  
imports: import collections
  import dataclasses
  import threading
  from typing import Optional, Sequence, Tuple
  from tensorboard.backend.event_processing import directory_watcher
  from tensorboard.backend.event_processing import event_file_loader
  from tensorboard.backend.event_processing import event_util
  from tensorboard.backend.event_processing import io_wrapper
  from tensorboard.backend.event_processing import plugin_asset_util
  from tensorboard.backend.event_processing import reservoir
  from tensorboard.backend.event_processing import tag_types
  from tensorboard.compat.proto import config_pb2
  from tensorboard.compat.proto import event_pb2
  from tensorboard.compat.proto import graph_pb2
  from tensorboard.compat.proto import meta_graph_pb2
  from tensorboard.compat.proto import tensor_pb2
  from tensorboard.plugins.distribution import compressor
  from tensorboard.util import tb_logging
label_desc: Use image node_id 21 for calling the EventAccumulator obj's underlying member method code with example usage: obj._CheckForRestartAndMaybePurge(event) without return types