code: def update_algorithm_or_clusters(attrname, old, new):
      global X
  
      algorithm = algorithm_select.value
      n_clusters = int(clusters_slider.value)
  
      X, y_pred = clustering(X, algorithm, n_clusters)
      colors = [spectral[i] for i in y_pred]
  
      source.data = dict(colors=colors, x=X[:, 0], y=X[:, 1])
  
      plot.title.text = algorithm
  
file_path: bokeh/examples/server/app/clustering/main.py
imports: import numpy
  from sklearn import cluster, datasets
  from sklearn.neighbors import kneighbors_graph
  from sklearn.preprocessing import StandardScaler
  from bokeh.io import curdoc
  from bokeh.layouts import column, row
  from bokeh.models import ColumnDataSource, Select, Slider
  from bokeh.palettes import Spectral6
  from bokeh.plotting import figure
label_desc: Use image node_id 3 for calling a global function with example usage: update_algorithm_or_clusters(attrname, old, new) without return types