code: def main():
      """Run online K-means on the sphere."""
      sphere = Hypersphere(dim=2)
  
      data = sphere.random_von_mises_fisher(kappa=10, n_samples=1000)
  
      n_clusters = 4
      clustering = OnlineKMeans(sphere, n_clusters=n_clusters)
      clustering = clustering.fit(data)
  
      plt.figure(0)
      ax = plt.subplot(111, projection="3d")
      visualization.plot(
          points=clustering.cluster_centers_, ax=ax, space="S2", c="r"
      )
      plt.show()
  
      plt.figure(1)
      ax = plt.subplot(111, projection="3d")
      sphere_plot = visualization.Sphere()
      sphere_plot.draw(ax=ax)
      for i in range(n_clusters):
          cluster = data[clustering.labels_ == i, :]
          sphere_plot.draw_points(ax=ax, points=cluster)
      plt.show()
  
imports: import logging
  import os
  import matplotlib.pyplot
  import geomstats.visualization
  from geomstats.geometry.hypersphere import Hypersphere
  from geomstats.learning.online_kmeans import OnlineKMeans
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types