code: def _imscatterplot(
      x: np.ndarray,
      y: np.ndarray,
      images: np.ndarray,
      ax: Optional[plt.Axes] = None,
      fig_kw: Optional[dict] = None,
      image_size: Tuple[int, int] = (28, 28),
      zoom: Optional[np.ndarray] = None,
      zoom_lb: float = 1.0,
      zoom_ub=2.0,
      sort_by_zoom: bool = True,
  ) -> plt.Axes:
      """
      2D image scatter plot.
  
      Parameters
      ----------
      x
          Images x-coordinates.
      y
          Images y-coordinates.
      images
          Array of images to be placed at coordinates `(x, y)`.
      ax
          A `matplotlib` axes object to plot on.
      fig_kw
          Keyword arguments passed to the `fig.set` function.
      image_size
          Size of the generated output image as `(rows, cols)`.
      zoom
          Images zoom to be used.
      zoom_lb
          Zoom lower bound. The zoom values will be scaled linearly between `[zoom_lb, zoom_up]`.
      zoom_ub
          Zoom upper bound. The zoom values will be scaled linearly between `[zoom_lb, zoom_up]`.
      """
      if fig_kw is None:
          fig_kw = {}
  
      if zoom is None:
          zoom = np.ones(len(images))
      else:
          zoom_min, zoom_max = np.min(zoom), np.max(zoom)
          zoom = (zoom - zoom_min) / (zoom_max - zoom_min) * (
              zoom_ub - zoom_lb
          ) + zoom_lb
  
          if sort_by_zoom:
              idx = np.argsort(zoom)[::-1]  # type: ignore
              zoom = zoom[idx]  # type: ignore
              x, y, images = x[idx], y[idx], images[idx]
  
      if ax is None:
          fig, ax = plt.subplots()
          ax.set_xticks([])
          ax.set_yticks([])
      else:
          fig = ax.figure  # type: ignore[assignment]
  
      resized_imgs = [
          resize(images[i], image_size) for i in range(len(images))
      ]
      imgs = [OffsetImage(img, zoom=zoom[i], cmap="gray") for i, img in enumerate(resized_imgs)]  # type: ignore
      artists = []
  
      for i in range(len(imgs)):
          x0, y0, im = x[i], y[i], imgs[i]
          ab = AnnotationBbox(
              im, (x0, y0), xycoords="data", frameon=False
          )
          artists.append(ax.add_artist(ab))
  
      ax.update_datalim(np.column_stack([x, y]))
      ax.autoscale()
      fig.set(**fig_kw)
      return ax
  
imports: import logging
  from copy import deepcopy
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from matplotlib.offsetbox import AnnotationBbox, OffsetImage
  from skimage.transform import resize
  from sklearn.model_selection import KFold
  from sklearn.neighbors import KNeighborsClassifier
  from tqdm import tqdm
  from alibi.api.defaults import DEFAULT_DATA_PROTOSELECT, DEFAULT_META_PROTOSELECT
  from alibi.api.interfaces import Explanation, FitMixin, Summariser
  from alibi.utils.distance import batch_compute_kernel_matrix
  from alibi.utils.kernel import EuclideanDistance
label_desc: Use image node_id 5 for calling a global function with example usage: _imscatterplot(x, y, images, ax, fig_kw, image_size, zoom, zoom_lb, zoom_ub, sort_by_zoom) and returns: ax