code: def testMultiThreadedEagerOpExecution(self):
      # Instrument for the main thread.
      instrument_0 = _NumpyFunctionCallback()
  
      # Instrument for the to-be-created thread.
      instrument_1 = _NumpyFunctionCallback()
  
      def thread_1_job():
          x = constant_op.constant(6.0)
          op_callbacks.add_op_callback(instrument_1.callback)
          y = math_ops.square(math_ops.log(x))
          op_callbacks.remove_op_callback(instrument_1.callback)
          return y
  
      thread_1 = threading.Thread(target=thread_1_job)
      thread_1.start()
  
      # While thread_1 is ongoing, do something on the main thread.
      x = constant_op.constant(2.0)
      op_callbacks.add_op_callback(instrument_0.callback)
      y = math_ops.cos(x)
      self.assertAllClose(y, np.cos(2.0))
      op_callbacks.remove_op_callback(instrument_0.callback)
  
      thread_1.join()
  
      self.assertEqual(instrument_0.eager_op_types, [_COS_OP])
      self.assertEqual(instrument_0.eager_op_names, [None])
      self.assertEqual(
          instrument_1.eager_op_types, [_LOG_OP, _SQUARE_OP]
      )
      self.assertEqual(instrument_1.eager_op_names, [None, None])
  
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 5 for calling the OpCallbacksTest obj's underlying member method code with example usage: obj.testMultiThreadedEagerOpExecution() and returns: y