code: def testWriteGraphOpCreationAndDebuggedGraphs(self):
      writer = debug_events_writer.DebugEventsWriter(
          self.dump_root, self.tfdbg_run_id
      )
      num_op_creations = 10
      for i in range(num_op_creations):
          graph_op_creation = debug_event_pb2.GraphOpCreation()
          graph_op_creation.op_type = "Conv2D"
          graph_op_creation.op_name = "Conv2D_%d" % i
          writer.WriteGraphOpCreation(graph_op_creation)
      debugged_graph = debug_event_pb2.DebuggedGraph()
      debugged_graph.graph_id = "deadbeaf"
      debugged_graph.graph_name = "MyGraph1"
      writer.WriteDebuggedGraph(debugged_graph)
      writer.FlushNonExecutionFiles()
  
      reader = debug_events_reader.DebugEventsReader(self.dump_root)
      actuals = list(
          item.debug_event for item in reader.graphs_iterator()
      )
      self.assertLen(actuals, num_op_creations + 1)
      for i in range(num_op_creations):
          self.assertEqual(
              actuals[i].graph_op_creation.op_type, "Conv2D"
          )
          self.assertEqual(
              actuals[i].graph_op_creation.op_name, "Conv2D_%d" % i
          )
      self.assertEqual(
          actuals[num_op_creations].debugged_graph.graph_id, "deadbeaf"
      )
  
imports: import glob
  import json
  import os
  import re
  import threading
  import time
  from absl.testing import parameterized
  from tensorflow.core.protobuf import debug_event_pb2
  from tensorflow.python.debug.lib import debug_events_reader
  from tensorflow.python.debug.lib import debug_events_writer
  from tensorflow.python.debug.lib import dumping_callback_test_lib
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework import versions
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 3 for calling the DebugEventsWriterTest obj's underlying member method code with example usage: obj.testWriteGraphOpCreationAndDebuggedGraphs() without return types