code: def testOpRegex(self, op_regex):
      x = constant_op.constant(2.0)
      y = constant_op.constant(3.0)
      writer = dumping_callback.enable_dump_debug_info(
          self.dump_root,
          tensor_debug_mode="FULL_TENSOR",
          op_regex=op_regex,
      )
  
      @def_function.function
      def log_sum(x, y):
          return math_ops.log(x + y)
  
      @def_function.function
      def sin1p_log_sum(x, y):
          return math_ops.sin(1.0 + log_sum(x, y))
  
      self.assertAllClose(
          self.evaluate(sin1p_log_sum(x, y)), np.sin(1.0 + np.log(5.0))
      )
      writer.FlushNonExecutionFiles()
      writer.FlushExecutionFiles()
  
      with debug_events_reader.DebugDataReader(
          self.dump_root
      ) as reader:
          reader.update()
          graph_op_digests = reader.graph_op_digests()
          op_types = [digest.op_type for digest in graph_op_digests]
          self.assertIn("AddV2", op_types)
          self.assertIn("Log", op_types)
          self.assertIn("Sin", op_types)
  
          graph_exec_digests = reader.graph_execution_traces(
              digest=True
          )
          executed_op_types = [
              digest.op_type for digest in graph_exec_digests
          ]
          tensor_values = [
              reader.graph_execution_trace_to_tensor_value(digest)
              for digest in graph_exec_digests
          ]
          if op_regex == "AddV2":
              self.assertEqual(executed_op_types, ["AddV2", "AddV2"])
              self.assertLen(tensor_values, 2)
              self.assertAllClose(
                  tensor_values[0], 5.0
              )  # 1st AddV2 op.
              self.assertAllClose(
                  tensor_values[1], np.log(5.0) + 1.0
              )  # 2nd AddV2 op.
          elif op_regex == "Log":
              self.assertEqual(executed_op_types, ["Log"])
              self.assertLen(tensor_values, 1)
              self.assertAllClose(
                  tensor_values[0], np.log(5.0)
              )  # Log op.
          else:  # "(AddV2|Log)"
              self.assertEqual(
                  executed_op_types, ["AddV2", "Log", "AddV2"]
              )
              self.assertLen(tensor_values, 3)
              self.assertAllClose(
                  tensor_values[0], 5.0
              )  # 1st AddV2 op.
              self.assertAllClose(
                  tensor_values[1], np.log(5.0)
              )  # Log op.
              self.assertAllClose(tensor_values[2], np.log(5.0) + 1.0)
  
imports: import collections
  import os
  import shutil
  import socket
  import tempfile
  import threading
  from absl.testing import parameterized
  import numpy
  from tensorflow.core.protobuf import debug_event_pb2
  from tensorflow.python.debug.lib import debug_events_reader
  from tensorflow.python.debug.lib import dumping_callback
  from tensorflow.python.debug.lib import dumping_callback_test_lib
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 18 for calling the DumpingCallbackTest obj's underlying member method code with example usage: obj.testOpRegex(op_regex) and returns: math_ops, math_ops