code: def write_summaries(self, summary):
      summary_ops = []
      writer = tf.summary.create_file_writer(summary.logdir)
      with writer.as_default():
          for summary_fn, tensor in summary.summary_tuples():
              summary_ops.append(summary_fn(tensor, step=10))
  
      writer_flush = writer.flush()
      self.evaluate(
          [tf.compat.v1.global_variables_initializer(), writer.init()]
      )
      self.evaluate(summary_ops)
      self.evaluate(writer_flush)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import struct
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.core import testing_utils
  from adanet.core.summary import _ScopedSummaryV2
  import tensorflow.compat.v2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 2 for calling the ScopedSummaryV2Test obj's underlying member method code with example usage: obj.write_summaries(summary) without return types