code: def image_event(self, *args, **kwargs):
      kwargs.setdefault("step", 1)
      writer = tf2.summary.create_file_writer(self.get_temp_dir())
      with writer.as_default():
          summary.image(*args, **kwargs)
      writer.close()
      event_files = sorted(
          glob.glob(os.path.join(self.get_temp_dir(), "*"))
      )
      self.assertEqual(len(event_files), 1)
      events = list(tf.compat.v1.train.summary_iterator(event_files[0]))
      # Expect a boilerplate event for the file_version, then the summary one.
      self.assertEqual(len(events), 2)
      # Delete the event file to reset to an empty directory for later calls.
      # TODO(nickfelt): use a unique subdirectory per writer instead.
      os.remove(event_files[0])
      return events[1]
  
imports: import glob
  import os
  import numpy
  import tensorflow
  from tensorboard.compat import tf2
  from tensorboard.compat.proto import summary_pb2
  from tensorboard.plugins.image import metadata
  from tensorboard.plugins.image import summary
label_desc: Use image node_id 3 for calling the SummaryV2OpTest obj's underlying member method code with example usage: obj.image_event() and returns: events