We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
embed/animated fails with "did not find model"
`Error rendering Bokeh items  Error: Did not find model ID_HERE in session`.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/embed/animated.py`
Content:
```
1 """ To view this example, first start a Bokeh server:
2 
3     bokeh serve --allow-websocket-origin=localhost:8000
4 
5 And then load the example into the Bokeh server by
6 running the script:
7 
8     python animated.py
9 
10 in this directory. Finally, start a simple web server
11 by running:
12 
13     python -m SimpleHTTPServer  (python 2)
14 
15 or
16 
17     python -m http.server  (python 3)
18 
19 in this directory. Navigate to
20 
21     http://localhost:8000/animated.html
22 
23 """
24 from __future__ import print_function
25 
26 from numpy import pi, cos, sin, linspace, roll
27 
28 from bokeh.client import push_session
29 from bokeh.embed import autoload_server
30 from bokeh.plotting import figure, curdoc
31 
32 M = 5
33 N = M*10 + 1
34 r_base = 8
35 theta = linspace(0, 2*pi, N)
36 r_x = linspace(0, 6*pi, N-1)
37 rmin = r_base - cos(r_x) - 1
38 rmax = r_base + sin(r_x) + 1
39 
40 colors = ["FFFFCC", "#C7E9B4", "#7FCDBB", "#41B6C4", "#2C7FB8",
41           "#253494", "#2C7FB8", "#41B6C4", "#7FCDBB", "#C7E9B4"] * 5
42 
43 # figure() function auto-adds the figure to curdoc()
44 p = figure(x_range=(-11, 11), y_range=(-11, 11))
45 r = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],
46                     fill_color=colors, line_color="white")
47 
48 # open a session which will keep our local doc in sync with server
49 session = push_session(curdoc())
50 
51 html = """
52 <html>
53   <head></head>
54   <body>
55     %s
56   </body>
57 </html>
58 """ % autoload_server(p, session_id=session.id)
59 
60 with open("animated.html", "w+") as f:
61     f.write(html)
62 
63 print(__doc__)
64 
65 ds = r.data_source
66 
67 def update():
68     rmin = roll(ds.data["inner_radius"], 1)
69     rmax = roll(ds.data["outer_radius"], -1)
70     ds.data.update(inner_radius=rmin, outer_radius=rmax)
71 
72 curdoc().add_periodic_callback(update, 30)
73 
74 session.loop_until_closed() # run forever
75
```
--- 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()

```

diff --git a/examples/embed/animated.py b/examples/embed/animated.py
--- a/examples/embed/animated.py
+++ b/examples/embed/animated.py
@@ -45,6 +45,9 @@
 r = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],
                     fill_color=colors, line_color="white")
 
+# add the plot to curdoc
+curdoc().add_root(p)
+
 # open a session which will keep our local doc in sync with server
 session = push_session(curdoc())

{"golden_diff": "diff --git a/examples/embed/animated.py b/examples/embed/animated.py\n--- a/examples/embed/animated.py\n+++ b/examples/embed/animated.py\n@@ -45,6 +45,9 @@\n r = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],\n                     fill_color=colors, line_color=\"white\")\n \n+# add the plot to curdoc\n+curdoc().add_root(p)\n+\n # open a session which will keep our local doc in sync with server\n session = push_session(curdoc())\n", "issue": "embed/animated fails with \"did not find model\"\n`Error rendering Bokeh items  Error: Did not find model ID_HERE in session`.\n\n", "before_files": [{"content": "\"\"\" To view this example, first start a Bokeh server:\n\n    bokeh serve --allow-websocket-origin=localhost:8000\n\nAnd then load the example into the Bokeh server by\nrunning the script:\n\n    python animated.py\n\nin this directory. Finally, start a simple web server\nby running:\n\n    python -m SimpleHTTPServer  (python 2)\n\nor\n\n    python -m http.server  (python 3)\n\nin this directory. Navigate to\n\n    http://localhost:8000/animated.html\n\n\"\"\"\nfrom __future__ import print_function\n\nfrom numpy import pi, cos, sin, linspace, roll\n\nfrom bokeh.client import push_session\nfrom bokeh.embed import autoload_server\nfrom bokeh.plotting import figure, curdoc\n\nM = 5\nN = M*10 + 1\nr_base = 8\ntheta = linspace(0, 2*pi, N)\nr_x = linspace(0, 6*pi, N-1)\nrmin = r_base - cos(r_x) - 1\nrmax = r_base + sin(r_x) + 1\n\ncolors = [\"FFFFCC\", \"#C7E9B4\", \"#7FCDBB\", \"#41B6C4\", \"#2C7FB8\",\n          \"#253494\", \"#2C7FB8\", \"#41B6C4\", \"#7FCDBB\", \"#C7E9B4\"] * 5\n\n# figure() function auto-adds the figure to curdoc()\np = figure(x_range=(-11, 11), y_range=(-11, 11))\nr = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],\n                    fill_color=colors, line_color=\"white\")\n\n# open a session which will keep our local doc in sync with server\nsession = push_session(curdoc())\n\nhtml = \"\"\"\n<html>\n  <head></head>\n  <body>\n    %s\n  </body>\n</html>\n\"\"\" % autoload_server(p, session_id=session.id)\n\nwith open(\"animated.html\", \"w+\") as f:\n    f.write(html)\n\nprint(__doc__)\n\nds = r.data_source\n\ndef update():\n    rmin = roll(ds.data[\"inner_radius\"], 1)\n    rmax = roll(ds.data[\"outer_radius\"], -1)\n    ds.data.update(inner_radius=rmin, outer_radius=rmax)\n\ncurdoc().add_periodic_callback(update, 30)\n\nsession.loop_until_closed() # run forever\n", "path": "examples/embed/animated.py"}], "after_files": [{"content": "\"\"\" To view this example, first start a Bokeh server:\n\n    bokeh serve --allow-websocket-origin=localhost:8000\n\nAnd then load the example into the Bokeh server by\nrunning the script:\n\n    python animated.py\n\nin this directory. Finally, start a simple web server\nby running:\n\n    python -m SimpleHTTPServer  (python 2)\n\nor\n\n    python -m http.server  (python 3)\n\nin this directory. Navigate to\n\n    http://localhost:8000/animated.html\n\n\"\"\"\nfrom __future__ import print_function\n\nfrom numpy import pi, cos, sin, linspace, roll\n\nfrom bokeh.client import push_session\nfrom bokeh.embed import autoload_server\nfrom bokeh.plotting import figure, curdoc\n\nM = 5\nN = M*10 + 1\nr_base = 8\ntheta = linspace(0, 2*pi, N)\nr_x = linspace(0, 6*pi, N-1)\nrmin = r_base - cos(r_x) - 1\nrmax = r_base + sin(r_x) + 1\n\ncolors = [\"FFFFCC\", \"#C7E9B4\", \"#7FCDBB\", \"#41B6C4\", \"#2C7FB8\",\n          \"#253494\", \"#2C7FB8\", \"#41B6C4\", \"#7FCDBB\", \"#C7E9B4\"] * 5\n\n# figure() function auto-adds the figure to curdoc()\np = figure(x_range=(-11, 11), y_range=(-11, 11))\nr = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],\n                    fill_color=colors, line_color=\"white\")\n\n# add the plot to curdoc\ncurdoc().add_root(p)\n\n# open a session which will keep our local doc in sync with server\nsession = push_session(curdoc())\n\nhtml = \"\"\"\n<html>\n  <head></head>\n  <body>\n    %s\n  </body>\n</html>\n\"\"\" % autoload_server(p, session_id=session.id)\n\nwith open(\"animated.html\", \"w+\") as f:\n    f.write(html)\n\nprint(__doc__)\n\nds = r.data_source\n\ndef update():\n    rmin = roll(ds.data[\"inner_radius\"], 1)\n    rmax = roll(ds.data[\"outer_radius\"], -1)\n    ds.data.update(inner_radius=rmin, outer_radius=rmax)\n\ncurdoc().add_periodic_callback(update, 30)\n\nsession.loop_until_closed() # run forever\n", "path": "examples/embed/animated.py"}]}