code: def testSingleThreadedStack(self):
      ctx = context.context()
      instrument_0 = _NumpyFunctionCallback()
      instrument_1 = _NumpyFunctionCallback()
  
      op_callbacks.add_op_callback(instrument_0.callback)
      self.assertEqual(1, len(ctx.op_callbacks))
      self.assertIn(instrument_0.callback, ctx.op_callbacks)
  
      op_callbacks.add_op_callback(instrument_1.callback)
      self.assertEqual(2, len(ctx.op_callbacks))
      self.assertIn(instrument_0.callback, ctx.op_callbacks)
      self.assertIn(instrument_1.callback, ctx.op_callbacks)
  
      op_callbacks.remove_op_callback(instrument_1.callback)
      self.assertEqual(1, len(ctx.op_callbacks))
      self.assertIn(instrument_0.callback, ctx.op_callbacks)
  
      op_callbacks.remove_op_callback(instrument_0.callback)
      self.assertEqual(0, len(ctx.op_callbacks))
  
imports: import threading
  import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import op_callbacks
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.util import compat
label_desc: Use image node_id 2 for calling the OpCallbacksTest obj's underlying member method code with example usage: obj.testSingleThreadedStack() without return types