code: def testTensorDTypesAndOpRegexFilters(self, tensor_dtypes, op_regex):
      xs = constant_op.constant(
          [2.0, 6.0, 8.0, 1.0, 2.0], dtype=dtypes.float32
      )
      writer = dumping_callback.enable_dump_debug_info(
          self.dump_root,
          tensor_debug_mode="FULL_TENSOR",
          tensor_dtypes=tensor_dtypes,
          op_regex=op_regex,
      )
  
      @def_function.function
      def unique_sum(xs):
          """Sum over the unique values, for testing."""
          unique_xs, indices = array_ops.unique(xs)
          return math_ops.reduce_sum(unique_xs), indices
  
      y, indices = self.evaluate(unique_sum(xs))
      self.assertAllClose(y, 17.0)
      self.assertAllEqual(indices, [0, 1, 2, 3, 0])
  
      writer.FlushNonExecutionFiles()
      writer.FlushExecutionFiles()
  
      with debug_events_reader.DebugDataReader(
          self.dump_root
      ) as reader:
          reader.update()
          graph_exec_digests = reader.graph_execution_traces(
              digest=True
          )
          executed_op_types = [
              digest.op_type
              for digest in graph_exec_digests
              if digest.op_type not in ("Const", "Placeholder")
          ]
          tensor_values = [
              reader.graph_execution_trace_to_tensor_value(digest)
              for digest in graph_exec_digests
              if digest.op_type not in ("Const", "Placeholder")
          ]
  
          if tensor_dtypes == [dtypes.float32] and not op_regex:
              self.assertEqual(executed_op_types, ["Unique", "Sum"])
              self.assertLen(tensor_values, 2)
              self.assertAllClose(
                  tensor_values[0], [2, 6, 8, 1]
              )  # Unique values.
              self.assertAllClose(tensor_values[1], 17.0)  # Sum.
          elif tensor_dtypes == ["float32"] and op_regex == "Sum":
              self.assertEqual(executed_op_types, ["Sum"])
              self.assertLen(tensor_values, 1)
              self.assertAllClose(tensor_values[0], 17.0)  # Sum.
          elif (
              tensor_dtypes == (dtypes.float32,)
              and op_regex == "(?!Sum)"
          ):
              self.assertEqual(executed_op_types, ["Unique"])
              self.assertLen(tensor_values, 1)
              self.assertAllClose(
                  tensor_values[0], [2, 6, 8, 1]
              )  # Unique values.
          elif tensor_dtypes == [dtypes.int32] and not op_regex:
              self.assertEqual(executed_op_types, ["Unique"])
              self.assertLen(tensor_values, 1)
              self.assertAllEqual(
                  tensor_values[0], [0, 1, 2, 3, 0]
              )  # Unique indices.
          elif callable(tensor_dtypes) and not op_regex:
              self.assertEqual(executed_op_types, ["Unique"])
              self.assertLen(tensor_values, 1)
              self.assertAllEqual(
                  tensor_values[0], [0, 1, 2, 3, 0]
              )  # Unique indices.
          elif not tensor_dtypes and op_regex == "(?!Sum)":
              self.assertEqual(executed_op_types, ["Unique", "Unique"])
              self.assertLen(tensor_values, 2)
              self.assertAllClose(
                  tensor_values[0], [2, 6, 8, 1]
              )  # Unique values.
              self.assertAllEqual(
                  tensor_values[1], [0, 1, 2, 3, 0]
              )  # Unique indices.
          else:  # "All".
              self.assertEqual(
                  executed_op_types, ["Unique", "Unique", "Sum"]
              )
              self.assertLen(tensor_values, 3)
              self.assertAllClose(
                  tensor_values[0], [2, 6, 8, 1]
              )  # Unique values.
              self.assertAllEqual(
                  tensor_values[1], [0, 1, 2, 3, 0]
              )  # Unique indices.
              self.assertAllClose(tensor_values[2], 17)
  
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 20 for calling the DumpingCallbackTest obj's underlying member method code with example usage: obj.testTensorDTypesAndOpRegexFilters(tensor_dtypes, op_regex) and returns: math_ops,  indices