code: def test_update_dynamic_map_with_stream(self):
      ys = np.arange(10)
  
      # Build stream
      Scale = Stream.define("Scale", scale=1.0)
      scale_stream = Scale()
  
      # Build DynamicMap
      def build_scatter(scale):
          return hv.Scatter(ys * scale)
  
      dmap = hv.DynamicMap(build_scatter, streams=[scale_stream])
  
      # Create HoloViews Pane using panel so that we can access the plotly pane
      # used to display the plotly figure
      dmap_pane = pn.pane.HoloViews(dmap, backend="plotly")
  
      # Call get_root to force instantiation of internal plots/models
      doc = Document()
      comm = Comm()
      dmap_pane.get_root(doc, comm)
  
      # Get reference to the plotly pane
      _, plotly_pane = next(iter(dmap_pane._plots.values()))
  
      # Check initial data
      data = plotly_pane.object["data"]
      self.assertEqual(len(data), 1)
      self.assertEqual(data[0]["type"], "scatter")
      np.testing.assert_equal(data[0]["y"], ys)
  
      # Watch object for changes
      fn = Mock()
      plotly_pane.param.watch(fn, "object")
  
      # Update stream
      scale_stream.event(scale=2.0)
  
      # Check that figure object was updated
      data = plotly_pane.object["data"]
      np.testing.assert_equal(data[0]["y"], ys * 2.0)
  
      # Check that object callback was triggered
      fn.assert_called_once()
      args, kwargs = fn.call_args_list[0]
      event = args[0]
      self.assertIs(event.obj, plotly_pane)
      self.assertIs(event.new, plotly_pane.object)
  
file_path: holoviews/holoviews/tests/plotting/plotly/test_dynamic.py
imports: from unittest.mock import Mock
  import numpy
  import panel
  from bokeh.document import Document
  from pyviz_comms import Comm
  import holoviews
  from holoviews.streams import BoundsXY, RangeXY, Selection1D, Stream
  from .test_plot import TestPlotlyPlot
label_desc: Use image node_id 1 for calling the TestDynamicMap obj's underlying member method code with example usage: obj.test_update_dynamic_map_with_stream() and returns: hv