code: def testNestedContextIsCapturedByGraphOpCreationHistory(self):
      x = constant_op.constant(2.0, dtype=dtypes.float32)
      times = constant_op.constant(4, dtype=dtypes.int32)
      writer = dumping_callback.enable_dump_debug_info(
          self.dump_root, tensor_debug_mode="NO_TENSOR"
      )
  
      @def_function.function
      def iterative_doubling(x, times):
          i = constant_op.constant(0, dtype=dtypes.int32)
          while i < times:
              x = x * 2.0 - 1.0
              i += 1
          return x
  
      # 2 * 2 - 1 = 3; 3 * 2 - 1 = 5; 5 * 2 - 1 = 9; 9 * 2 - 1 = 17.
      self.assertAllClose(
          self.evaluate(iterative_doubling(x, times)), 17.0
      )
  
      writer.FlushNonExecutionFiles()
      writer.FlushExecutionFiles()
      with debug_events_reader.DebugDataReader(
          self.dump_root
      ) as reader:
          reader.update()
          less_op_digest = reader.graph_op_digests(op_type="Less")[-1]
          mul_op_digest = reader.graph_op_digests(op_type="Mul")[-1]
          sub_op_digest = reader.graph_op_digests(op_type="Sub")[-1]
          # The Less op is from the while-loop cond context and hence should have
          # a different innermost context ID from the mul and sub ops, which are
          # both from the while-loop body context.
          self.assertNotEqual(
              less_op_digest.graph_id, mul_op_digest.graph_id
          )
          self.assertNotEqual(
              less_op_digest.graph_id, sub_op_digest.graph_id
          )
          # The Mul and Sub ops are from the same innermost context.
          self.assertEqual(
              mul_op_digest.graph_id, sub_op_digest.graph_id
          )
  
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 28 for calling the DumpingCallbackTest obj's underlying member method code with example usage: obj.testNestedContextIsCapturedByGraphOpCreationHistory() and returns: x