code: def test__imscatterplot(plot_data, use_zoom):
      """Test `_imscatterplot` function."""
      ax = _imscatterplot(
          x=plot_data["x"],
          y=plot_data["y"],
          images=plot_data["images"],
          image_size=plot_data["image_size"],
          zoom=plot_data["zoom"] if use_zoom else None,
          zoom_lb=plot_data["zoom_lb"],
          zoom_ub=plot_data["zoom_ub"],
          sort_by_zoom=True,
      )
  
      annboxes = [
          x
          for x in ax.get_children()
          if isinstance(x, matplotlib.offsetbox.AnnotationBbox)
      ]
      data = np.array(
          [annbox.offsetbox.get_data() for annbox in annboxes]
      )
      zoom = np.array(
          [annbox.offsetbox.get_zoom() for annbox in annboxes]
      )
  
      sorted_idx = (
          np.argsort(plot_data["zoom"])[::-1] if use_zoom else None
      )
      expected_data = plot_data["images"][sorted_idx]
  
      if not use_zoom:
          expected_zoom = np.ones(len(plot_data["zoom"]))
      else:
          expected_zoom = plot_data["zoom"][sorted_idx]
          expected_zoom = (expected_zoom - expected_zoom.min()) / (
              expected_zoom.max() - expected_zoom.min()
          )
          expected_zoom = (
              expected_zoom
              * (plot_data["zoom_ub"] - plot_data["zoom_lb"])
              + plot_data["zoom_lb"]
          )
  
      assert np.allclose(expected_data, data)
      assert np.allclose(expected_zoom, zoom)
  
imports: from copy import deepcopy
  import matplotlib
  import numpy
  import pytest
  from sklearn.datasets import make_classification
  from sklearn.model_selection import train_test_split
  from alibi.api.defaults import DEFAULT_DATA_PROTOSELECT, DEFAULT_META_PROTOSELECT
  from alibi.api.interfaces import Explanation
  from alibi.prototypes import ProtoSelect
  from alibi.prototypes.protoselect import _batch_preprocessing, _imscatterplot, compute_prototype_importances, cv_protoselect_euclidean, visualize_image_prototypes
  from alibi.utils.kernel import EuclideanDistance
label_desc: Use image node_id 9 for calling a global function with example usage: test__imscatterplot(plot_data, use_zoom) without return types