code: def write_summaries(self, summary):
      summary_ops = []
      writer = summary_ops_v2.create_file_writer(summary.logdir)
      with writer.as_default(), summary_ops_v2.always_record_summaries():
          for summary_fn, tensor in summary.summary_tuples():
              summary_ops.append(summary_fn(tensor, step=10))
  
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          sess.run(summary_ops_v2.summary_writer_initializer_op())
          sess.run(summary_ops)
          sess.run(writer.flush())
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import os
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.core import testing_utils
  from adanet.core.summary import _ScopedSummary
  from adanet.core.summary import _TPUScopedSummary
  from adanet.core.summary import monkey_patched_summaries
  from six.moves import range
  import tensorflow.compat.v1
  from tensorflow.python.ops import summary_ops_v2
label_desc: Use image node_id 2 for calling the TPUScopedSummaryTest obj's underlying member method code with example usage: obj.write_summaries(summary) without return types