class_docstr: Thread that logs events.
class_docstr_tok: ["Thread","that","logs","events","."]
code: def run(self):
      try:
          while True:
              event = self._queue.get()
              if event is self._close_sentinel:
                  return
              elif event is self._flush_sentinel:
                  self._ev_writer.Flush()
                  self._flush_complete.set()
              else:
                  self._ev_writer.WriteEvent(event)
                  # Flush the event writer every so often.
                  now = time.time()
                  if now > self._next_event_flush_time:
                      self._ev_writer.Flush()
                      self._next_event_flush_time = (
                          now + self._flush_secs
                      )
      except Exception as e:
          logging.error("EventFileWriter writer thread error: %s", e)
          self.failure_exc_info = sys.exc_info()
          raise
      finally:
          # When exiting the thread, always complete any pending flush operation
          # (to unblock flush() calls) and close the queue (to unblock add_event()
          # calls, including those used by flush() and close()), which ensures that
          # code using EventFileWriter doesn't deadlock if this thread dies.
          self._flush_complete.set()
          self._queue.close()
  
imports: import collections
  import os.path
  import sys
  import threading
  import time
  from tensorflow.python.client import _pywrap_events_writer
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
label_desc: Use image node_id 2 for calling the _EventLoggerThread obj's underlying member method code with example usage: obj.run() without return types