code: def elbow_analysis(sample_file_path, kmin, kmax, **kwargs):
      initializer = kwargs.get(
          "initializer", kmeans_plusplus_initializer
      )
      sample = read_sample(sample_file_path)
  
      elbow_instance = elbow(
          sample, kmin, kmax, initializer=initializer
      )
      elbow_instance.process()
  
      amount_clusters = elbow_instance.get_amount()
      wce = elbow_instance.get_wce()
  
      centers = kmeans_plusplus_initializer(
          sample, amount_clusters
      ).initialize()
      kmeans_instance = kmeans(sample, centers)
      kmeans_instance.process()
      clusters = kmeans_instance.get_clusters()
      centers = kmeans_instance.get_centers()
  
      print(
          "Sample '%s': Obtained amount of clusters: '%d'."
          % (sample_file_path, amount_clusters)
      )
  
      figure = plt.figure(1)
      ax = figure.add_subplot(111)
      ax.plot(range(kmin, kmax), wce, color="b", marker=".")
      ax.plot(
          amount_clusters,
          wce[amount_clusters - kmin],
          color="r",
          marker=".",
          markersize=10,
      )
      ax.annotate(
          "Elbow",
          (amount_clusters + 0.1, wce[amount_clusters - kmin] + 5),
      )
      ax.grid(True)
      plt.ylabel("WCE")
      plt.xlabel("K")
      plt.show()
  
      kmeans_visualizer.show_clusters(sample, clusters, centers)
  
imports: import matplotlib.pyplot
  from pyclustering.cluster.center_initializer import kmeans_plusplus_initializer, random_center_initializer
  from pyclustering.cluster.elbow import elbow
  from pyclustering.cluster.kmeans import kmeans, kmeans_visualizer
  from pyclustering.utils import read_sample
  from pyclustering.samples.definitions import SIMPLE_SAMPLES
label_desc: Use image node_id 1 for calling a global function with example usage: elbow_analysis(sample_file_path, kmin, kmax) without return types