code: def gen(move_chance=0.05):
      centre = int(
          random.random() * 3
      )  # 3x faster than random.randint(0, 2)
      if random.random() < move_chance:
          centres[centre][0] += random.random() / 5 - 0.1
          centres[centre][1] += random.random() / 5 - 0.1
      value = {
          "x": random.random() / 20 + centres[centre][0],
          "y": random.random() / 20 + centres[centre][1],
      }
      count[0] += 1
      return value
  
file_path: streamz/examples/river_kmeans.py
imports: import functools
  import random
  import time
  import pandas
  from streamz import Stream
  import hvplot.streamz
  from streamz.river import RiverTrain
  from river import cluster
  import holoviews
  from panel.pane.holoviews import HoloViews
  import panel
label_desc: Use image node_id 1 for calling a global function with example usage: gen(move_chance) and returns: value