We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Game of Life example needs update
### Package versions
```
panel     = 0.13.1
holoviews = 1.15.0
bokeh     = 2.4.3
```


### Bug description
In the Game of Life example in the holoviews documentation (https://holoviews.org/gallery/apps/bokeh/game_of_life.html) 
I needed to update the second to last line
```python
panel.add_periodic_callback(advance, 50)
```

to
```python
pn.state.add_periodic_callback(advance, period=50)   # 50 msec 
# note: the `period=` is not necessary, but I think it adds clarity
```
It seems this is due to a change in the `panel` interface.


--- 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/gallery/apps/bokeh/game_of_life.py`
Content:
```
1 import numpy as np
2 import holoviews as hv
3 import panel as pn
4 
5 from holoviews import opts
6 from holoviews.streams import Tap, Counter, DoubleTap
7 from scipy.signal import convolve2d
8 
9 hv.extension('bokeh')
10 
11 diehard = [[0, 0, 0, 0, 0, 0, 1, 0],
12            [1, 1, 0, 0, 0, 0, 0, 0],
13            [0, 1, 0, 0, 0, 1, 1, 1]]
14 
15 boat = [[1, 1, 0],
16         [1, 0, 1],
17         [0, 1, 0]]
18 
19 r_pentomino = [[0, 1, 1],
20                [1, 1, 0],
21                [0, 1, 0]]
22 
23 beacon = [[0, 0, 1, 1],
24           [0, 0, 1, 1],
25           [1, 1, 0, 0],
26           [1, 1, 0, 0]]
27 
28 acorn = [[0, 1, 0, 0, 0, 0, 0],
29          [0, 0, 0, 1, 0, 0, 0],
30          [1, 1, 0, 0, 1, 1, 1]]
31 
32 spaceship = [[0, 0, 1, 1, 0],
33              [1, 1, 0, 1, 1],
34              [1, 1, 1, 1, 0],
35              [0, 1, 1, 0, 0]]
36 
37 block_switch_engine = [[0, 0, 0, 0, 0, 0, 1, 0],
38                        [0, 0, 0, 0, 1, 0, 1, 1],
39                        [0, 0, 0, 0, 1, 0, 1, 0],
40                        [0, 0, 0, 0, 1, 0, 0, 0],
41                        [0, 0, 1, 0, 0, 0, 0, 0],
42                        [1, 0, 1, 0, 0, 0, 0, 0]]
43 
44 glider = [[1, 0, 0], [0, 1, 1], [1, 1, 0]]
45 
46 unbounded = [[1, 1, 1, 0, 1],
47             [1, 0, 0, 0, 0],
48             [0, 0, 0, 1, 1],
49             [0, 1, 1, 0, 1],
50             [1, 0, 1, 0, 1]]
51 
52 shapes = {'Glider': glider, 'Block Switch Engine': block_switch_engine,
53           'Spaceship': spaceship, 'Acorn': acorn, 'Beacon': beacon,
54           'Diehard': diehard, 'Unbounded': unbounded}
55 
56 def step(X):
57     nbrs_count = convolve2d(X, np.ones((3, 3)), mode='same', boundary='wrap') - X
58     return (nbrs_count == 3) | (X & (nbrs_count == 2))
59 
60 def update(pattern, counter, x, y):
61     if x and y:
62         pattern = np.array(shapes[pattern])
63         r, c = pattern.shape
64         y, x = img.sheet2matrixidx(x,y)
65         img.data[y:y+r,x:x+c] = pattern[::-1]
66     else:
67         img.data = step(img.data)
68     return hv.Image(img)
69 
70 # Set up plot which advances on counter and adds pattern on tap
71 title = 'Game of Life - Tap to place pattern, Doubletap to clear'
72 img = hv.Image(np.zeros((100, 200), dtype=np.uint8))
73 counter, tap = Counter(transient=True), Tap(transient=True),
74 pattern_dim = hv.Dimension('Pattern', values=sorted(shapes.keys()))
75 dmap = hv.DynamicMap(update, kdims=[pattern_dim], streams=[counter, tap])
76 
77 plot = dmap.opts(
78     opts.Image(cmap='gray', clim=(0, 1), toolbar=None, responsive=True,
79                min_height=800, title=title, xaxis=None, yaxis=None)
80 )
81 
82 # Add callback to clear on double tap
83 def reset_data(x, y):
84     img.data[:] = 0
85 
86 reset = DoubleTap(transient=True, source=plot)
87 reset.add_subscriber(reset_data)
88 
89 # Set up Panel app and periodic callback
90 panel = pn.pane.HoloViews(plot, center=True, widget_location='right')
91 
92 def advance():
93     counter.event(counter=counter.counter+1)
94 panel.add_periodic_callback(advance, 50)
95 
96 panel.servable('Game of Life')
97
```
--- 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/gallery/apps/bokeh/game_of_life.py b/examples/gallery/apps/bokeh/game_of_life.py
--- a/examples/gallery/apps/bokeh/game_of_life.py
+++ b/examples/gallery/apps/bokeh/game_of_life.py
@@ -91,6 +91,6 @@
 
 def advance():
     counter.event(counter=counter.counter+1)
-panel.add_periodic_callback(advance, 50)
+pn.state.add_periodic_callback(advance, period=50, start=False)
 
 panel.servable('Game of Life')

{"golden_diff": "diff --git a/examples/gallery/apps/bokeh/game_of_life.py b/examples/gallery/apps/bokeh/game_of_life.py\n--- a/examples/gallery/apps/bokeh/game_of_life.py\n+++ b/examples/gallery/apps/bokeh/game_of_life.py\n@@ -91,6 +91,6 @@\n \n def advance():\n     counter.event(counter=counter.counter+1)\n-panel.add_periodic_callback(advance, 50)\n+pn.state.add_periodic_callback(advance, period=50, start=False)\n \n panel.servable('Game of Life')\n", "issue": "Game of Life example needs update\n### Package versions\r\n```\r\npanel     = 0.13.1\r\nholoviews = 1.15.0\r\nbokeh     = 2.4.3\r\n```\r\n\r\n\r\n### Bug description\r\nIn the Game of Life example in the holoviews documentation (https://holoviews.org/gallery/apps/bokeh/game_of_life.html) \r\nI needed to update the second to last line\r\n```python\r\npanel.add_periodic_callback(advance, 50)\r\n```\r\n\r\nto\r\n```python\r\npn.state.add_periodic_callback(advance, period=50)   # 50 msec \r\n# note: the `period=` is not necessary, but I think it adds clarity\r\n```\r\nIt seems this is due to a change in the `panel` interface.\r\n\n", "before_files": [{"content": "import numpy as np\nimport holoviews as hv\nimport panel as pn\n\nfrom holoviews import opts\nfrom holoviews.streams import Tap, Counter, DoubleTap\nfrom scipy.signal import convolve2d\n\nhv.extension('bokeh')\n\ndiehard = [[0, 0, 0, 0, 0, 0, 1, 0],\n           [1, 1, 0, 0, 0, 0, 0, 0],\n           [0, 1, 0, 0, 0, 1, 1, 1]]\n\nboat = [[1, 1, 0],\n        [1, 0, 1],\n        [0, 1, 0]]\n\nr_pentomino = [[0, 1, 1],\n               [1, 1, 0],\n               [0, 1, 0]]\n\nbeacon = [[0, 0, 1, 1],\n          [0, 0, 1, 1],\n          [1, 1, 0, 0],\n          [1, 1, 0, 0]]\n\nacorn = [[0, 1, 0, 0, 0, 0, 0],\n         [0, 0, 0, 1, 0, 0, 0],\n         [1, 1, 0, 0, 1, 1, 1]]\n\nspaceship = [[0, 0, 1, 1, 0],\n             [1, 1, 0, 1, 1],\n             [1, 1, 1, 1, 0],\n             [0, 1, 1, 0, 0]]\n\nblock_switch_engine = [[0, 0, 0, 0, 0, 0, 1, 0],\n                       [0, 0, 0, 0, 1, 0, 1, 1],\n                       [0, 0, 0, 0, 1, 0, 1, 0],\n                       [0, 0, 0, 0, 1, 0, 0, 0],\n                       [0, 0, 1, 0, 0, 0, 0, 0],\n                       [1, 0, 1, 0, 0, 0, 0, 0]]\n\nglider = [[1, 0, 0], [0, 1, 1], [1, 1, 0]]\n\nunbounded = [[1, 1, 1, 0, 1],\n            [1, 0, 0, 0, 0],\n            [0, 0, 0, 1, 1],\n            [0, 1, 1, 0, 1],\n            [1, 0, 1, 0, 1]]\n\nshapes = {'Glider': glider, 'Block Switch Engine': block_switch_engine,\n          'Spaceship': spaceship, 'Acorn': acorn, 'Beacon': beacon,\n          'Diehard': diehard, 'Unbounded': unbounded}\n\ndef step(X):\n    nbrs_count = convolve2d(X, np.ones((3, 3)), mode='same', boundary='wrap') - X\n    return (nbrs_count == 3) | (X & (nbrs_count == 2))\n\ndef update(pattern, counter, x, y):\n    if x and y:\n        pattern = np.array(shapes[pattern])\n        r, c = pattern.shape\n        y, x = img.sheet2matrixidx(x,y)\n        img.data[y:y+r,x:x+c] = pattern[::-1]\n    else:\n        img.data = step(img.data)\n    return hv.Image(img)\n\n# Set up plot which advances on counter and adds pattern on tap\ntitle = 'Game of Life - Tap to place pattern, Doubletap to clear'\nimg = hv.Image(np.zeros((100, 200), dtype=np.uint8))\ncounter, tap = Counter(transient=True), Tap(transient=True),\npattern_dim = hv.Dimension('Pattern', values=sorted(shapes.keys()))\ndmap = hv.DynamicMap(update, kdims=[pattern_dim], streams=[counter, tap])\n\nplot = dmap.opts(\n    opts.Image(cmap='gray', clim=(0, 1), toolbar=None, responsive=True,\n               min_height=800, title=title, xaxis=None, yaxis=None)\n)\n\n# Add callback to clear on double tap\ndef reset_data(x, y):\n    img.data[:] = 0\n\nreset = DoubleTap(transient=True, source=plot)\nreset.add_subscriber(reset_data)\n\n# Set up Panel app and periodic callback\npanel = pn.pane.HoloViews(plot, center=True, widget_location='right')\n\ndef advance():\n    counter.event(counter=counter.counter+1)\npanel.add_periodic_callback(advance, 50)\n\npanel.servable('Game of Life')\n", "path": "examples/gallery/apps/bokeh/game_of_life.py"}], "after_files": [{"content": "import numpy as np\nimport holoviews as hv\nimport panel as pn\n\nfrom holoviews import opts\nfrom holoviews.streams import Tap, Counter, DoubleTap\nfrom scipy.signal import convolve2d\n\nhv.extension('bokeh')\n\ndiehard = [[0, 0, 0, 0, 0, 0, 1, 0],\n           [1, 1, 0, 0, 0, 0, 0, 0],\n           [0, 1, 0, 0, 0, 1, 1, 1]]\n\nboat = [[1, 1, 0],\n        [1, 0, 1],\n        [0, 1, 0]]\n\nr_pentomino = [[0, 1, 1],\n               [1, 1, 0],\n               [0, 1, 0]]\n\nbeacon = [[0, 0, 1, 1],\n          [0, 0, 1, 1],\n          [1, 1, 0, 0],\n          [1, 1, 0, 0]]\n\nacorn = [[0, 1, 0, 0, 0, 0, 0],\n         [0, 0, 0, 1, 0, 0, 0],\n         [1, 1, 0, 0, 1, 1, 1]]\n\nspaceship = [[0, 0, 1, 1, 0],\n             [1, 1, 0, 1, 1],\n             [1, 1, 1, 1, 0],\n             [0, 1, 1, 0, 0]]\n\nblock_switch_engine = [[0, 0, 0, 0, 0, 0, 1, 0],\n                       [0, 0, 0, 0, 1, 0, 1, 1],\n                       [0, 0, 0, 0, 1, 0, 1, 0],\n                       [0, 0, 0, 0, 1, 0, 0, 0],\n                       [0, 0, 1, 0, 0, 0, 0, 0],\n                       [1, 0, 1, 0, 0, 0, 0, 0]]\n\nglider = [[1, 0, 0], [0, 1, 1], [1, 1, 0]]\n\nunbounded = [[1, 1, 1, 0, 1],\n            [1, 0, 0, 0, 0],\n            [0, 0, 0, 1, 1],\n            [0, 1, 1, 0, 1],\n            [1, 0, 1, 0, 1]]\n\nshapes = {'Glider': glider, 'Block Switch Engine': block_switch_engine,\n          'Spaceship': spaceship, 'Acorn': acorn, 'Beacon': beacon,\n          'Diehard': diehard, 'Unbounded': unbounded}\n\ndef step(X):\n    nbrs_count = convolve2d(X, np.ones((3, 3)), mode='same', boundary='wrap') - X\n    return (nbrs_count == 3) | (X & (nbrs_count == 2))\n\ndef update(pattern, counter, x, y):\n    if x and y:\n        pattern = np.array(shapes[pattern])\n        r, c = pattern.shape\n        y, x = img.sheet2matrixidx(x,y)\n        img.data[y:y+r,x:x+c] = pattern[::-1]\n    else:\n        img.data = step(img.data)\n    return hv.Image(img)\n\n# Set up plot which advances on counter and adds pattern on tap\ntitle = 'Game of Life - Tap to place pattern, Doubletap to clear'\nimg = hv.Image(np.zeros((100, 200), dtype=np.uint8))\ncounter, tap = Counter(transient=True), Tap(transient=True),\npattern_dim = hv.Dimension('Pattern', values=sorted(shapes.keys()))\ndmap = hv.DynamicMap(update, kdims=[pattern_dim], streams=[counter, tap])\n\nplot = dmap.opts(\n    opts.Image(cmap='gray', clim=(0, 1), toolbar=None, responsive=True,\n               min_height=800, title=title, xaxis=None, yaxis=None)\n)\n\n# Add callback to clear on double tap\ndef reset_data(x, y):\n    img.data[:] = 0\n\nreset = DoubleTap(transient=True, source=plot)\nreset.add_subscriber(reset_data)\n\n# Set up Panel app and periodic callback\npanel = pn.pane.HoloViews(plot, center=True, widget_location='right')\n\ndef advance():\n    counter.event(counter=counter.counter+1)\npn.state.add_periodic_callback(advance, period=50, start=False)\n\npanel.servable('Game of Life')\n", "path": "examples/gallery/apps/bokeh/game_of_life.py"}]}