code: def testCallbackClassInstanceTracking(self):
      # Each callback class should track all active instances of its own class in a
      # weak value dictionary. Here we make sure that instances stay separated per
      # class
      plot1 = mock_plot()
      plot2 = mock_plot()
      plot3 = mock_plot()
  
      # Check RangeXYCallback
      rangexy_cb = RangeXYCallback(plot1, [], None)
      self.assertIn(plot1.trace_uid, RangeXYCallback.instances)
      self.assertIs(
          rangexy_cb, RangeXYCallback.instances[plot1.trace_uid]
      )
  
      # Check BoundsXYCallback
      boundsxy_cb = BoundsXYCallback(plot2, [], None)
      self.assertIn(plot2.trace_uid, BoundsXYCallback.instances)
      self.assertIs(
          boundsxy_cb, BoundsXYCallback.instances[plot2.trace_uid]
      )
  
      # Check Selection1DCallback
      selection1d_cb = Selection1DCallback(plot3, [], None)
      self.assertIn(plot3.trace_uid, Selection1DCallback.instances)
      self.assertIs(
          selection1d_cb, Selection1DCallback.instances[plot3.trace_uid]
      )
  
      # Check that objects don't show up as instances in the wrong class
      self.assertNotIn(plot1.trace_uid, BoundsXYCallback.instances)
      self.assertNotIn(plot1.trace_uid, Selection1DCallback.instances)
      self.assertNotIn(plot2.trace_uid, RangeXYCallback.instances)
      self.assertNotIn(plot2.trace_uid, Selection1DCallback.instances)
      self.assertNotIn(plot3.trace_uid, RangeXYCallback.instances)
      self.assertNotIn(plot3.trace_uid, BoundsXYCallback.instances)
  
imports: import uuid
  from unittest import TestCase
  from unittest.mock import Mock
  import plotly.graph_objs
  from holoviews import Tiles
  from holoviews.plotting.plotly.callbacks import BoundsXCallback, BoundsXYCallback, BoundsYCallback, RangeXCallback, RangeXYCallback, RangeYCallback, Selection1DCallback
  from holoviews.streams import BoundsX, BoundsXY, BoundsY, RangeX, RangeXY, RangeY, Selection1D
label_desc: Use image node_id 2 for calling the TestCallbacks obj's underlying member method code with example usage: obj.testCallbackClassInstanceTracking() without return types