prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  embed/animated fails with "did not find model"
  `Error rendering Bokeh items  Error: Did not find model ID_HERE in session`.
  
  
  </issue>
  <code>
  [start of examples/embed/animated.py]
  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 of examples/embed/animated.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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())
  
verification_info: {"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"}]}