code: def kelbow_visualizer(
      model,
      X,
      y=None,
      ax=None,
      k=10,
      metric="distortion",
      distance_metric="euclidean",
      timings=True,
      locate_elbow=True,
      show=True,
      **kwargs,
  ):
      """
      Quick Method:
  
      model : a Scikit-Learn clusterer
          Should be an instance of an unfitted clusterer, specifically
          ``KMeans`` or ``MiniBatchKMeans``. If it is not a clusterer, an
          exception is raised.
  
      X : array-like of shape (n, m)
          A matrix or data frame with n instances and m features
  
      y : array-like of shape (n,), optional
          A vector or series representing the target for each instance
  
      ax : matplotlib Axes, default: None
          The axes to plot the figure on. If None is passed in the current axes
          will be used (or generated if required).
  
      k : integer, tuple, or iterable
          The k values to compute silhouette scores for. If a single integer
          is specified, then will compute the range (2,k). If a tuple of 2
          integers is specified, then k will be in np.arange(k[0], k[1]).
          Otherwise, specify an iterable of integers to use as values for k.
  
      metric : string, default: ``"distortion"``
          Select the scoring metric to evaluate the clusters. The default is the
          mean distortion, defined by the sum of squared distances between each
          observation and its closest centroid. Other metrics include:
  
          - **distortion**: mean sum of squared distances to centers
          - **silhouette**: mean ratio of intra-cluster and nearest-cluster
                            distance
          - **calinski_harabasz**: ratio of within to between cluster dispersion
  
      distance_metric : str or callable, default='euclidean'
          The metric to use when calculating distance between instances in a
          feature array. If metric is a string, it must be one of the options allowed
          by sklearn's metrics.pairwise.pairwise_distances. If X is the distance array
          itself, use metric="precomputed".
  
      timings : bool, default: True
          Display the fitting time per k to evaluate the amount of time required
          to train the clustering model.
  
      locate_elbow : bool, default: True
          Automatically find the "elbow" or "knee" which likely corresponds to
          the optimal value of k using the "knee point detection algorithm". The
          knee point detection algorithm finds the point of maximum curvature,
          which in a well-behaved clustering problem also represents the pivot
          of the elbow curve. The point is labeled with a dashed line and
          annotated with the score and k values.
  
      show : bool, default: True
          If True, calls ``show()``, which in turn calls ``plt.show()`` however
          you cannot call ``plt.savefig`` from this signature, nor
          ``clear_figure``. If False, simply calls ``finalize()``
  
      kwargs : dict
          Keyword arguments that are passed to the base class and may influence
          the visualization as defined in other Visualizers.
  
      Returns
      -------
      viz : KElbowVisualizer
          The kelbow visualizer, fitted and finalized.
      """
      klass = type(model)
  
      # figure out which kwargs correspond to fit method
      fit_params = get_param_names(klass.fit)
  
      fit_kwargs = {
          key: kwargs.pop(key) for key in fit_params if key in kwargs
      }
  
      oz = KElbow(
          model,
          ax=ax,
          k=k,
          metric=metric,
          distance_metric="euclidean",
          timings=timings,
          locate_elbow=locate_elbow,
          **kwargs,
      )
      oz.fit(X, y, **fit_kwargs)
  
      if show:
          oz.show()
      else:
          oz.finalize()
  
      return oz
  
imports: import time
  import warnings
  import numpy
  import scipy.sparse
  from collections.abc import Iterable
  from sklearn.preprocessing import LabelEncoder
  from sklearn.metrics.pairwise import pairwise_distances
  from sklearn.metrics import silhouette_score, DistanceMetric
  from yellowbrick.utils import KneeLocator, get_param_names
  from yellowbrick.style.palettes import LINE_COLOR
  from yellowbrick.cluster.base import ClusteringScoreVisualizer
  from yellowbrick.exceptions import YellowbrickValueError, YellowbrickWarning
label_desc: Use image node_id 2 for calling a global function with example usage: kelbow_visualizer(model, X, y, ax, k, metric, distance_metric, timings, locate_elbow, show) and returns: oz