code: def nearest_neighbour_distribution(umap_object, bins=25, ax=None):
      """Create a histogram of the average distance to each points
      nearest neighbors.
  
      Parameters
      ----------
      umap_object: trained UMAP object
          A trained UMAP object that has an embedding.
  
      bins: int (optional, default 25)
          Number of bins to put the points into
  
      ax: matplotlib axis (optional, default None)
          A matplotlib axis to plot to, or, if None, a new
          axis will be created and returned.
  
      Returns
      -------
  
      """
      nn_distances = average_nn_distance(umap_object.graph_)
  
      if ax is None:
          fig = plt.figure()
          ax = fig.add_subplot(111)
  
      ax.set_xlabel(f"Average distance to nearest neighbors")
      ax.set_ylabel("Frequency")
  
      ax.hist(nn_distances, bins=bins)
  
      return ax
  
imports: import numpy
  import numba
  from warnings import warn
  import sklearn.decomposition
  import sklearn.cluster
  import sklearn.neighbors
  from matplotlib.patches import Patch
  from umap.utils import submatrix, average_nn_distance
  from bokeh.plotting import show
  from bokeh.plotting import output_file, output_notebook
  from bokeh.layouts import column
  from bokeh.models import CustomJS, TextInput
  from matplotlib.pyplot import show
  from warnings import warn
label_desc: Use image node_id 20 for calling a global function with example usage: nearest_neighbour_distribution(umap_object, bins, ax) and returns: ax