code: def cluster(dataset: str, n_clusters: int, clustering_algorithm: str):
      if isinstance(n_clusters, dict):
          n_clusters = n_clusters["value"]
      else:
          n_clusters = int(n_clusters)
  
      X, labels = DATA_MAPPING[dataset](n_clusters)
      model = MODEL_MAPPING[clustering_algorithm](
          X, labels, n_clusters=n_clusters
      )
      if hasattr(model, "labels_"):
          y_pred = model.labels_.astype(int)
      else:
          y_pred = model.predict(X)
  
      fig, ax = plt.subplots(figsize=FIGSIZE)
  
      plot_clusters(ax, X, y_pred)
      ax.set_title(clustering_algorithm, fontsize=16)
  
      return fig
  
imports: import gradio
  import math
  from functools import partial
  import matplotlib.pyplot
  import numpy
  from sklearn.cluster import AgglomerativeClustering, Birch, DBSCAN, KMeans, MeanShift, OPTICS, SpectralClustering, estimate_bandwidth
  from sklearn.datasets import make_blobs, make_circles, make_moons
  from sklearn.mixture import GaussianMixture
  from sklearn.neighbors import kneighbors_graph
  from sklearn.preprocessing import StandardScaler
label_desc: Use image node_id 19 for calling a global function with example usage: cluster(dataset, n_clusters, clustering_algorithm) and returns: fig