code: def __init__(
      self, logdir, flush_secs=2, is_dummy=False, dummy_time=None
  ):
      self._name_to_tf_name = {}
      self._tf_names = set()
      self.is_dummy = is_dummy
      self.logdir = logdir
      self.flush_secs = flush_secs  # TODO
      self._writer = None
      self._dummy_time = dummy_time
      if is_dummy:
          self.dummy_log = defaultdict(list)
      else:
          if not os.path.exists(self.logdir):
              os.makedirs(self.logdir)
          hostname = socket.gethostname()
          filename = os.path.join(
              self.logdir,
              "events.out.tfevents.{}.{}".format(
                  int(self._time()), hostname
              ),
          )
          self._writer = open(filename, "wb")
          self._write_event(
              event_pb2.Event(
                  wall_time=self._time(),
                  step=0,
                  file_version="brain.Event:2",
              )
          )
  
imports: from collections import defaultdict
  import os
  import re
  import socket
  import struct
  import time
  import numpy
  import six
  import scipy.misc
  from .crc32c import crc32c
label_desc: Use image node_id 1 to create a new Logger object from inherited base classes: object with example: obj = Logger(logdir, flush_secs, is_dummy, dummy_time)