prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  "CustomJS for Selections" Example in Docs Broken
  In the latest version of the docs, it appears [this example]( https://bokeh.pydata.org/en/latest/docs/user_guide/interaction/callbacks.html#customjs-for-selections ) is broken. This is also true of the example in the Bokeh 1.0.0 docs. Selecting points in the plot on the left does not result in points being shown in the right plot. Compare this to [the same plot using Bokeh 0.13.0]( https://bokeh.pydata.org/en/0.13.0/docs/user_guide/interaction/callbacks.html#customjs-for-selections ), which seems to work without issues.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py`
  Content:
  ```
  1 from random import random
  2 
  3 from bokeh.layouts import row
  4 from bokeh.models import CustomJS, ColumnDataSource
  5 from bokeh.plotting import figure, output_file, show
  6 
  7 output_file("callback.html")
  8 
  9 x = [random() for x in range(500)]
  10 y = [random() for y in range(500)]
  11 
  12 s1 = ColumnDataSource(data=dict(x=x, y=y))
  13 p1 = figure(plot_width=400, plot_height=400, tools="lasso_select", title="Select Here")
  14 p1.circle('x', 'y', source=s1, alpha=0.6)
  15 
  16 s2 = ColumnDataSource(data=dict(x=[], y=[]))
  17 p2 = figure(plot_width=400, plot_height=400, x_range=(0, 1), y_range=(0, 1),
  18             tools="", title="Watch Here")
  19 p2.circle('x', 'y', source=s2, alpha=0.6)
  20 
  21 s1.callback = CustomJS(args=dict(s2=s2), code="""
  22         var inds = cb_obj.selected.indices;
  23         var d1 = cb_obj.data;
  24         var d2 = s2.data;
  25         d2['x'] = []
  26         d2['y'] = []
  27         for (var i = 0; i < inds.length; i++) {
  28             d2['x'].push(d1['x'][inds[i]])
  29             d2['y'].push(d1['y'][inds[i]])
  30         }
  31         s2.change.emit();
  32     """)
  33 
  34 layout = row(p1, p2)
  35 
  36 show(layout)
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py b/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py
  --- a/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py
  +++ b/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py
  @@ -18,9 +18,9 @@
               tools="", title="Watch Here")
   p2.circle('x', 'y', source=s2, alpha=0.6)
   
  -s1.callback = CustomJS(args=dict(s2=s2), code="""
  -        var inds = cb_obj.selected.indices;
  -        var d1 = cb_obj.data;
  +s1.selected.js_on_change('indices', CustomJS(args=dict(s1=s1, s2=s2), code="""
  +        var inds = cb_obj.indices;
  +        var d1 = s1.data;
           var d2 = s2.data;
           d2['x'] = []
           d2['y'] = []
  @@ -30,6 +30,7 @@
           }
           s2.change.emit();
       """)
  +)
   
   layout = row(p1, p2)
  
verification_info: {"golden_diff": "diff --git a/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py b/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py\n--- a/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py\n+++ b/sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py\n@@ -18,9 +18,9 @@\n             tools=\"\", title=\"Watch Here\")\n p2.circle('x', 'y', source=s2, alpha=0.6)\n \n-s1.callback = CustomJS(args=dict(s2=s2), code=\"\"\"\n-        var inds = cb_obj.selected.indices;\n-        var d1 = cb_obj.data;\n+s1.selected.js_on_change('indices', CustomJS(args=dict(s1=s1, s2=s2), code=\"\"\"\n+        var inds = cb_obj.indices;\n+        var d1 = s1.data;\n         var d2 = s2.data;\n         d2['x'] = []\n         d2['y'] = []\n@@ -30,6 +30,7 @@\n         }\n         s2.change.emit();\n     \"\"\")\n+)\n \n layout = row(p1, p2)\n", "issue": "\"CustomJS for Selections\" Example in Docs Broken\nIn the latest version of the docs, it appears [this example]( https://bokeh.pydata.org/en/latest/docs/user_guide/interaction/callbacks.html#customjs-for-selections ) is broken. This is also true of the example in the Bokeh 1.0.0 docs. Selecting points in the plot on the left does not result in points being shown in the right plot. Compare this to [the same plot using Bokeh 0.13.0]( https://bokeh.pydata.org/en/0.13.0/docs/user_guide/interaction/callbacks.html#customjs-for-selections ), which seems to work without issues.\n", "before_files": [{"content": "from random import random\n\nfrom bokeh.layouts import row\nfrom bokeh.models import CustomJS, ColumnDataSource\nfrom bokeh.plotting import figure, output_file, show\n\noutput_file(\"callback.html\")\n\nx = [random() for x in range(500)]\ny = [random() for y in range(500)]\n\ns1 = ColumnDataSource(data=dict(x=x, y=y))\np1 = figure(plot_width=400, plot_height=400, tools=\"lasso_select\", title=\"Select Here\")\np1.circle('x', 'y', source=s1, alpha=0.6)\n\ns2 = ColumnDataSource(data=dict(x=[], y=[]))\np2 = figure(plot_width=400, plot_height=400, x_range=(0, 1), y_range=(0, 1),\n            tools=\"\", title=\"Watch Here\")\np2.circle('x', 'y', source=s2, alpha=0.6)\n\ns1.callback = CustomJS(args=dict(s2=s2), code=\"\"\"\n        var inds = cb_obj.selected.indices;\n        var d1 = cb_obj.data;\n        var d2 = s2.data;\n        d2['x'] = []\n        d2['y'] = []\n        for (var i = 0; i < inds.length; i++) {\n            d2['x'].push(d1['x'][inds[i]])\n            d2['y'].push(d1['y'][inds[i]])\n        }\n        s2.change.emit();\n    \"\"\")\n\nlayout = row(p1, p2)\n\nshow(layout)\n", "path": "sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py"}], "after_files": [{"content": "from random import random\n\nfrom bokeh.layouts import row\nfrom bokeh.models import CustomJS, ColumnDataSource\nfrom bokeh.plotting import figure, output_file, show\n\noutput_file(\"callback.html\")\n\nx = [random() for x in range(500)]\ny = [random() for y in range(500)]\n\ns1 = ColumnDataSource(data=dict(x=x, y=y))\np1 = figure(plot_width=400, plot_height=400, tools=\"lasso_select\", title=\"Select Here\")\np1.circle('x', 'y', source=s1, alpha=0.6)\n\ns2 = ColumnDataSource(data=dict(x=[], y=[]))\np2 = figure(plot_width=400, plot_height=400, x_range=(0, 1), y_range=(0, 1),\n            tools=\"\", title=\"Watch Here\")\np2.circle('x', 'y', source=s2, alpha=0.6)\n\ns1.selected.js_on_change('indices', CustomJS(args=dict(s1=s1, s2=s2), code=\"\"\"\n        var inds = cb_obj.indices;\n        var d1 = s1.data;\n        var d2 = s2.data;\n        d2['x'] = []\n        d2['y'] = []\n        for (var i = 0; i < inds.length; i++) {\n            d2['x'].push(d1['x'][inds[i]])\n            d2['y'].push(d1['y'][inds[i]])\n        }\n        s2.change.emit();\n    \"\"\")\n)\n\nlayout = row(p1, p2)\n\nshow(layout)\n", "path": "sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections.py"}]}