class_docstr: Writes `Event` protocol buffers to an event file.
  
  The `EventFileWriter` class creates an event file in the specified
  directory, and asynchronously writes Event protocol buffers to the
  file. The Event file is encoded using the tfrecord format, which is
  similar to RecordIO.
docstr: Creates a `EventFileWriter` and an event file to write to.
  
  On construction the summary writer creates a new event file in `logdir`.
  This event file will contain `Event` protocol buffers, which are written to
  disk via the add_event method.
  The other arguments to the constructor control the asynchronous writes to
  the event file:
  
  Args:
    logdir: A string. Directory where event file will be written.
    max_queue_size: Integer. Size of the queue for pending events and summaries.
    flush_secs: Number. How often, in seconds, to flush the
      pending events and summaries to disk.
docstr_tok: ["Creates","a","`","EventFileWriter","`","and","an","event","file","to","write","to",".","On","construction","the","summary","writer","creates","a","new","event","file","in","`","logdir","`",".","This","event","file","will","contain","`","Event","`","protocol","buffers",",","which","are","written","to","disk","via","the","add_event","method",".","The","other","arguments","to","the","constructor","control","the","asynchronous","writes","to","the","event","file",":","Args",":","logdir",":","A","string",".","Directory","where","event","file","will","be","written",".","max_queue_size",":","Integer",".","Size","of","the","queue","for","pending","events","and","summaries",".","flush_secs",":","Number",".","How","often",",","in","seconds",",","to","flush","the","pending","events","and","summaries","to","disk","."]
code: def __init__(
      self,
      logdir,
      max_queue_size=10,
      flush_secs=120,
      filename_suffix="",
  ):
      """Creates a `EventFileWriter` and an event file to write to.
  
      On construction the summary writer creates a new event file in `logdir`.
      This event file will contain `Event` protocol buffers, which are written to
      disk via the add_event method.
      The other arguments to the constructor control the asynchronous writes to
      the event file:
  
      Args:
        logdir: A string. Directory where event file will be written.
        max_queue_size: Integer. Size of the queue for pending events and summaries.
        flush_secs: Number. How often, in seconds, to flush the
          pending events and summaries to disk.
      """
      self._logdir = logdir
      tf.io.gfile.makedirs(logdir)
      self._file_name = (
          os.path.join(
              logdir,
              "events.out.tfevents.%010d.%s.%s.%s"
              % (
                  time.time(),
                  socket.gethostname(),
                  os.getpid(),
                  _global_uid.get(),
              ),
          )
          + filename_suffix
      )  # noqa E128
      self._general_file_writer = tf.io.gfile.GFile(
          self._file_name, "wb"
      )
      self._async_writer = _AsyncWriter(
          RecordWriter(self._general_file_writer),
          max_queue_size,
          flush_secs,
      )
  
      # Initialize an event instance.
      _event = event_pb2.Event(
          wall_time=time.time(),
          file_version="brain.Event:2",
          source_metadata=event_pb2.SourceMetadata(
              writer="tensorboard.summary.writer.event_file_writer"
          ),
      )
      self.add_event(_event)
      self.flush()
  
imports: import os
  import queue
  import socket
  import threading
  import time
  from tensorboard.compat import tf
  from tensorboard.compat.proto import event_pb2
  from tensorboard.summary.writer.record_writer import RecordWriter
label_desc: Use image node_id 1 to create a new EventFileWriter object  with example: obj = EventFileWriter(logdir, max_queue_size, flush_secs, filename_suffix)