We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
clustering app example needs updates for recent changes
Fails because `theme.yaml` tries to set `title_text_font_size` on `Plot` This bypasses the (python) property that deprecates this former `Plot` property, and tries to set a (Bokeh) property with that name directly on the plot. This fails, because of the work to make `Title` its own model.

Will fix up the `theme.yaml` and note this problem in migration guide. Since we barely demonstrated and not discussed the theming, hopefully this will not bite many people at all. 


--- 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/app/clustering/main.py`
Content:
```
1 import numpy as np
2 np.random.seed(0)
3 
4 from bokeh.io import curdoc
5 from bokeh.models import ColumnDataSource, VBox, HBox, Select, Slider
6 from bokeh.plotting import Figure
7 from bokeh.palettes import Spectral6
8 
9 from sklearn import cluster, datasets
10 from sklearn.neighbors import kneighbors_graph
11 from sklearn.preprocessing import StandardScaler
12 
13 # define some helper functions
14 def clustering(X, algorithm, n_clusters):
15     # normalize dataset for easier parameter selection
16     X = StandardScaler().fit_transform(X)
17 
18     # estimate bandwidth for mean shift
19     bandwidth = cluster.estimate_bandwidth(X, quantile=0.3)
20 
21     # connectivity matrix for structured Ward
22     connectivity = kneighbors_graph(X, n_neighbors=10, include_self=False)
23 
24     # make connectivity symmetric
25     connectivity = 0.5 * (connectivity + connectivity.T)
26 
27     # Generate the new colors:
28     if algorithm=='MiniBatchKMeans':
29         model = cluster.MiniBatchKMeans(n_clusters=n_clusters)
30 
31     elif algorithm=='Birch':
32         model = cluster.Birch(n_clusters=n_clusters)
33 
34     elif algorithm=='DBSCAN':
35         model = cluster.DBSCAN(eps=.2)
36 
37     elif algorithm=='AffinityPropagation':
38         model = cluster.AffinityPropagation(damping=.9,
39                                             preference=-200)
40 
41     elif algorithm=='MeanShift':
42         model = cluster.MeanShift(bandwidth=bandwidth,
43                                   bin_seeding=True)
44 
45     elif algorithm=='SpectralClustering':
46         model = cluster.SpectralClustering(n_clusters=n_clusters,
47                                            eigen_solver='arpack',
48                                            affinity="nearest_neighbors")
49 
50     elif algorithm=='Ward':
51         model = cluster.AgglomerativeClustering(n_clusters=n_clusters,
52                                                 linkage='ward',
53                                                 connectivity=connectivity)
54 
55     elif algorithm=='AgglomerativeClustering':
56         model = cluster.AgglomerativeClustering(linkage="average",
57                                                 affinity="cityblock",
58                                                 n_clusters=n_clusters,
59                                                 connectivity=connectivity)
60 
61     model.fit(X)
62 
63     if hasattr(model, 'labels_'):
64             y_pred = model.labels_.astype(np.int)
65     else:
66             y_pred = model.predict(X)
67 
68     return X, y_pred
69 
70 def get_dataset(dataset, n_samples):
71     if dataset == 'Noisy Circles':
72         return datasets.make_circles(n_samples=n_samples,
73                                     factor=0.5,
74                                     noise=0.05)
75 
76     elif dataset == 'Noisy Moons':
77         return datasets.make_moons(n_samples=n_samples,
78                                    noise=0.05)
79 
80     elif dataset == 'Blobs':
81         return datasets.make_blobs(n_samples=n_samples,
82                                    random_state=8)
83 
84     elif dataset == "No Structure":
85         return np.random.rand(n_samples, 2), None
86 
87 # set up initial data
88 n_samples = 1500
89 n_clusters = 2
90 algorithm = 'MiniBatchKMeans'
91 dataset = 'Noisy Circles'
92 
93 X, y = get_dataset(dataset, n_samples)
94 X, y_pred = clustering(X, algorithm, n_clusters)
95 spectral = np.hstack([Spectral6] * 20)
96 colors = [spectral[i] for i in y]
97 
98 # set up plot (styling in theme.yaml)
99 plot = Figure(toolbar_location=None, title=algorithm)
100 source = ColumnDataSource(data=dict(x=X[:, 0], y=X[:, 1], colors=colors))
101 plot.circle('x', 'y', fill_color='colors', line_color=None, source=source)
102 
103 # set up widgets
104 clustering_algorithms= [
105     'MiniBatchKMeans',
106     'AffinityPropagation',
107     'MeanShift',
108     'SpectralClustering',
109     'Ward',
110     'AgglomerativeClustering',
111     'DBSCAN',
112     'Birch'
113 ]
114 
115 datasets_names = [
116     'Noisy Circles',
117     'Noisy Moons',
118     'Blobs',
119     'No Structure'
120 ]
121 
122 algorithm_select = Select(value='MiniBatchKMeans',
123                           title='Select algorithm:',
124                           options=clustering_algorithms)
125 
126 dataset_select = Select(value='Noisy Circles',
127                         title='Select dataset:',
128                         options=datasets_names)
129 
130 samples_slider = Slider(title="Number of samples",
131                         value=1500.0,
132                         start=1000.0,
133                         end=3000.0,
134                         step=100)
135 
136 clusters_slider = Slider(title="Number of clusters",
137                          value=2.0,
138                          start=2.0,
139                          end=10.0,
140                          step=1)
141 
142 # set up callbacks
143 def update_algorithm_or_clusters(attrname, old, new):
144     global X
145 
146     algorithm = algorithm_select.value
147     n_clusters = int(clusters_slider.value)
148 
149     X, y_pred = clustering(X, algorithm, n_clusters)
150     colors = [spectral[i] for i in y_pred]
151 
152     source.data['colors'] = colors
153     source.data['x'] = X[:, 0]
154     source.data['y'] = X[:, 1]
155 
156     plot.title = algorithm
157 
158 def update_samples_or_dataset(attrname, old, new):
159     global X, y
160 
161     dataset = dataset_select.value
162     algorithm = algorithm_select.value
163     n_clusters = int(clusters_slider.value)
164     n_samples = int(samples_slider.value)
165 
166     X, y = get_dataset(dataset, n_samples)
167     X, y_pred = clustering(X, algorithm, n_clusters)
168     colors = [spectral[i] for i in y_pred]
169 
170     source.data['x'] = X[:, 0]
171     source.data['y'] = X[:, 1]
172     source.data['colors'] = colors
173 
174 algorithm_select.on_change('value', update_algorithm_or_clusters)
175 clusters_slider.on_change('value', update_algorithm_or_clusters)
176 
177 dataset_select.on_change('value', update_samples_or_dataset)
178 samples_slider.on_change('value', update_samples_or_dataset)
179 
180 # set up layout
181 selects = HBox(dataset_select, algorithm_select)
182 inputs = VBox(samples_slider, clusters_slider, selects)
183 
184 # add to document
185 curdoc().add_root(HBox(inputs, plot, width=800))
186
```
--- 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/app/clustering/main.py b/examples/app/clustering/main.py
--- a/examples/app/clustering/main.py
+++ b/examples/app/clustering/main.py
@@ -153,7 +153,7 @@
     source.data['x'] = X[:, 0]
     source.data['y'] = X[:, 1]
 
-    plot.title = algorithm
+    plot.title.text = algorithm
 
 def update_samples_or_dataset(attrname, old, new):
     global X, y

{"golden_diff": "diff --git a/examples/app/clustering/main.py b/examples/app/clustering/main.py\n--- a/examples/app/clustering/main.py\n+++ b/examples/app/clustering/main.py\n@@ -153,7 +153,7 @@\n     source.data['x'] = X[:, 0]\n     source.data['y'] = X[:, 1]\n \n-    plot.title = algorithm\n+    plot.title.text = algorithm\n \n def update_samples_or_dataset(attrname, old, new):\n     global X, y\n", "issue": "clustering app example needs updates for recent changes\nFails because `theme.yaml` tries to set `title_text_font_size` on `Plot` This bypasses the (python) property that deprecates this former `Plot` property, and tries to set a (Bokeh) property with that name directly on the plot. This fails, because of the work to make `Title` its own model.\n\nWill fix up the `theme.yaml` and note this problem in migration guide. Since we barely demonstrated and not discussed the theming, hopefully this will not bite many people at all. \n\n", "before_files": [{"content": "import numpy as np\nnp.random.seed(0)\n\nfrom bokeh.io import curdoc\nfrom bokeh.models import ColumnDataSource, VBox, HBox, Select, Slider\nfrom bokeh.plotting import Figure\nfrom bokeh.palettes import Spectral6\n\nfrom sklearn import cluster, datasets\nfrom sklearn.neighbors import kneighbors_graph\nfrom sklearn.preprocessing import StandardScaler\n\n# define some helper functions\ndef clustering(X, algorithm, n_clusters):\n    # normalize dataset for easier parameter selection\n    X = StandardScaler().fit_transform(X)\n\n    # estimate bandwidth for mean shift\n    bandwidth = cluster.estimate_bandwidth(X, quantile=0.3)\n\n    # connectivity matrix for structured Ward\n    connectivity = kneighbors_graph(X, n_neighbors=10, include_self=False)\n\n    # make connectivity symmetric\n    connectivity = 0.5 * (connectivity + connectivity.T)\n\n    # Generate the new colors:\n    if algorithm=='MiniBatchKMeans':\n        model = cluster.MiniBatchKMeans(n_clusters=n_clusters)\n\n    elif algorithm=='Birch':\n        model = cluster.Birch(n_clusters=n_clusters)\n\n    elif algorithm=='DBSCAN':\n        model = cluster.DBSCAN(eps=.2)\n\n    elif algorithm=='AffinityPropagation':\n        model = cluster.AffinityPropagation(damping=.9,\n                                            preference=-200)\n\n    elif algorithm=='MeanShift':\n        model = cluster.MeanShift(bandwidth=bandwidth,\n                                  bin_seeding=True)\n\n    elif algorithm=='SpectralClustering':\n        model = cluster.SpectralClustering(n_clusters=n_clusters,\n                                           eigen_solver='arpack',\n                                           affinity=\"nearest_neighbors\")\n\n    elif algorithm=='Ward':\n        model = cluster.AgglomerativeClustering(n_clusters=n_clusters,\n                                                linkage='ward',\n                                                connectivity=connectivity)\n\n    elif algorithm=='AgglomerativeClustering':\n        model = cluster.AgglomerativeClustering(linkage=\"average\",\n                                                affinity=\"cityblock\",\n                                                n_clusters=n_clusters,\n                                                connectivity=connectivity)\n\n    model.fit(X)\n\n    if hasattr(model, 'labels_'):\n            y_pred = model.labels_.astype(np.int)\n    else:\n            y_pred = model.predict(X)\n\n    return X, y_pred\n\ndef get_dataset(dataset, n_samples):\n    if dataset == 'Noisy Circles':\n        return datasets.make_circles(n_samples=n_samples,\n                                    factor=0.5,\n                                    noise=0.05)\n\n    elif dataset == 'Noisy Moons':\n        return datasets.make_moons(n_samples=n_samples,\n                                   noise=0.05)\n\n    elif dataset == 'Blobs':\n        return datasets.make_blobs(n_samples=n_samples,\n                                   random_state=8)\n\n    elif dataset == \"No Structure\":\n        return np.random.rand(n_samples, 2), None\n\n# set up initial data\nn_samples = 1500\nn_clusters = 2\nalgorithm = 'MiniBatchKMeans'\ndataset = 'Noisy Circles'\n\nX, y = get_dataset(dataset, n_samples)\nX, y_pred = clustering(X, algorithm, n_clusters)\nspectral = np.hstack([Spectral6] * 20)\ncolors = [spectral[i] for i in y]\n\n# set up plot (styling in theme.yaml)\nplot = Figure(toolbar_location=None, title=algorithm)\nsource = ColumnDataSource(data=dict(x=X[:, 0], y=X[:, 1], colors=colors))\nplot.circle('x', 'y', fill_color='colors', line_color=None, source=source)\n\n# set up widgets\nclustering_algorithms= [\n    'MiniBatchKMeans',\n    'AffinityPropagation',\n    'MeanShift',\n    'SpectralClustering',\n    'Ward',\n    'AgglomerativeClustering',\n    'DBSCAN',\n    'Birch'\n]\n\ndatasets_names = [\n    'Noisy Circles',\n    'Noisy Moons',\n    'Blobs',\n    'No Structure'\n]\n\nalgorithm_select = Select(value='MiniBatchKMeans',\n                          title='Select algorithm:',\n                          options=clustering_algorithms)\n\ndataset_select = Select(value='Noisy Circles',\n                        title='Select dataset:',\n                        options=datasets_names)\n\nsamples_slider = Slider(title=\"Number of samples\",\n                        value=1500.0,\n                        start=1000.0,\n                        end=3000.0,\n                        step=100)\n\nclusters_slider = Slider(title=\"Number of clusters\",\n                         value=2.0,\n                         start=2.0,\n                         end=10.0,\n                         step=1)\n\n# set up callbacks\ndef update_algorithm_or_clusters(attrname, old, new):\n    global X\n\n    algorithm = algorithm_select.value\n    n_clusters = int(clusters_slider.value)\n\n    X, y_pred = clustering(X, algorithm, n_clusters)\n    colors = [spectral[i] for i in y_pred]\n\n    source.data['colors'] = colors\n    source.data['x'] = X[:, 0]\n    source.data['y'] = X[:, 1]\n\n    plot.title = algorithm\n\ndef update_samples_or_dataset(attrname, old, new):\n    global X, y\n\n    dataset = dataset_select.value\n    algorithm = algorithm_select.value\n    n_clusters = int(clusters_slider.value)\n    n_samples = int(samples_slider.value)\n\n    X, y = get_dataset(dataset, n_samples)\n    X, y_pred = clustering(X, algorithm, n_clusters)\n    colors = [spectral[i] for i in y_pred]\n\n    source.data['x'] = X[:, 0]\n    source.data['y'] = X[:, 1]\n    source.data['colors'] = colors\n\nalgorithm_select.on_change('value', update_algorithm_or_clusters)\nclusters_slider.on_change('value', update_algorithm_or_clusters)\n\ndataset_select.on_change('value', update_samples_or_dataset)\nsamples_slider.on_change('value', update_samples_or_dataset)\n\n# set up layout\nselects = HBox(dataset_select, algorithm_select)\ninputs = VBox(samples_slider, clusters_slider, selects)\n\n# add to document\ncurdoc().add_root(HBox(inputs, plot, width=800))\n", "path": "examples/app/clustering/main.py"}], "after_files": [{"content": "import numpy as np\nnp.random.seed(0)\n\nfrom bokeh.io import curdoc\nfrom bokeh.models import ColumnDataSource, VBox, HBox, Select, Slider\nfrom bokeh.plotting import Figure\nfrom bokeh.palettes import Spectral6\n\nfrom sklearn import cluster, datasets\nfrom sklearn.neighbors import kneighbors_graph\nfrom sklearn.preprocessing import StandardScaler\n\n# define some helper functions\ndef clustering(X, algorithm, n_clusters):\n    # normalize dataset for easier parameter selection\n    X = StandardScaler().fit_transform(X)\n\n    # estimate bandwidth for mean shift\n    bandwidth = cluster.estimate_bandwidth(X, quantile=0.3)\n\n    # connectivity matrix for structured Ward\n    connectivity = kneighbors_graph(X, n_neighbors=10, include_self=False)\n\n    # make connectivity symmetric\n    connectivity = 0.5 * (connectivity + connectivity.T)\n\n    # Generate the new colors:\n    if algorithm=='MiniBatchKMeans':\n        model = cluster.MiniBatchKMeans(n_clusters=n_clusters)\n\n    elif algorithm=='Birch':\n        model = cluster.Birch(n_clusters=n_clusters)\n\n    elif algorithm=='DBSCAN':\n        model = cluster.DBSCAN(eps=.2)\n\n    elif algorithm=='AffinityPropagation':\n        model = cluster.AffinityPropagation(damping=.9,\n                                            preference=-200)\n\n    elif algorithm=='MeanShift':\n        model = cluster.MeanShift(bandwidth=bandwidth,\n                                  bin_seeding=True)\n\n    elif algorithm=='SpectralClustering':\n        model = cluster.SpectralClustering(n_clusters=n_clusters,\n                                           eigen_solver='arpack',\n                                           affinity=\"nearest_neighbors\")\n\n    elif algorithm=='Ward':\n        model = cluster.AgglomerativeClustering(n_clusters=n_clusters,\n                                                linkage='ward',\n                                                connectivity=connectivity)\n\n    elif algorithm=='AgglomerativeClustering':\n        model = cluster.AgglomerativeClustering(linkage=\"average\",\n                                                affinity=\"cityblock\",\n                                                n_clusters=n_clusters,\n                                                connectivity=connectivity)\n\n    model.fit(X)\n\n    if hasattr(model, 'labels_'):\n            y_pred = model.labels_.astype(np.int)\n    else:\n            y_pred = model.predict(X)\n\n    return X, y_pred\n\ndef get_dataset(dataset, n_samples):\n    if dataset == 'Noisy Circles':\n        return datasets.make_circles(n_samples=n_samples,\n                                    factor=0.5,\n                                    noise=0.05)\n\n    elif dataset == 'Noisy Moons':\n        return datasets.make_moons(n_samples=n_samples,\n                                   noise=0.05)\n\n    elif dataset == 'Blobs':\n        return datasets.make_blobs(n_samples=n_samples,\n                                   random_state=8)\n\n    elif dataset == \"No Structure\":\n        return np.random.rand(n_samples, 2), None\n\n# set up initial data\nn_samples = 1500\nn_clusters = 2\nalgorithm = 'MiniBatchKMeans'\ndataset = 'Noisy Circles'\n\nX, y = get_dataset(dataset, n_samples)\nX, y_pred = clustering(X, algorithm, n_clusters)\nspectral = np.hstack([Spectral6] * 20)\ncolors = [spectral[i] for i in y]\n\n# set up plot (styling in theme.yaml)\nplot = Figure(toolbar_location=None, title=algorithm)\nsource = ColumnDataSource(data=dict(x=X[:, 0], y=X[:, 1], colors=colors))\nplot.circle('x', 'y', fill_color='colors', line_color=None, source=source)\n\n# set up widgets\nclustering_algorithms= [\n    'MiniBatchKMeans',\n    'AffinityPropagation',\n    'MeanShift',\n    'SpectralClustering',\n    'Ward',\n    'AgglomerativeClustering',\n    'DBSCAN',\n    'Birch'\n]\n\ndatasets_names = [\n    'Noisy Circles',\n    'Noisy Moons',\n    'Blobs',\n    'No Structure'\n]\n\nalgorithm_select = Select(value='MiniBatchKMeans',\n                          title='Select algorithm:',\n                          options=clustering_algorithms)\n\ndataset_select = Select(value='Noisy Circles',\n                        title='Select dataset:',\n                        options=datasets_names)\n\nsamples_slider = Slider(title=\"Number of samples\",\n                        value=1500.0,\n                        start=1000.0,\n                        end=3000.0,\n                        step=100)\n\nclusters_slider = Slider(title=\"Number of clusters\",\n                         value=2.0,\n                         start=2.0,\n                         end=10.0,\n                         step=1)\n\n# set up callbacks\ndef update_algorithm_or_clusters(attrname, old, new):\n    global X\n\n    algorithm = algorithm_select.value\n    n_clusters = int(clusters_slider.value)\n\n    X, y_pred = clustering(X, algorithm, n_clusters)\n    colors = [spectral[i] for i in y_pred]\n\n    source.data['colors'] = colors\n    source.data['x'] = X[:, 0]\n    source.data['y'] = X[:, 1]\n\n    plot.title.text = algorithm\n\ndef update_samples_or_dataset(attrname, old, new):\n    global X, y\n\n    dataset = dataset_select.value\n    algorithm = algorithm_select.value\n    n_clusters = int(clusters_slider.value)\n    n_samples = int(samples_slider.value)\n\n    X, y = get_dataset(dataset, n_samples)\n    X, y_pred = clustering(X, algorithm, n_clusters)\n    colors = [spectral[i] for i in y_pred]\n\n    source.data['x'] = X[:, 0]\n    source.data['y'] = X[:, 1]\n    source.data['colors'] = colors\n\nalgorithm_select.on_change('value', update_algorithm_or_clusters)\nclusters_slider.on_change('value', update_algorithm_or_clusters)\n\ndataset_select.on_change('value', update_samples_or_dataset)\nsamples_slider.on_change('value', update_samples_or_dataset)\n\n# set up layout\nselects = HBox(dataset_select, algorithm_select)\ninputs = VBox(samples_slider, clusters_slider, selects)\n\n# add to document\ncurdoc().add_root(HBox(inputs, plot, width=800))\n", "path": "examples/app/clustering/main.py"}]}