class_docstr: Interactive wrapper for a matplotlib collection.
  
  This class enables collection points to be lasso-ed and click selected.
  
  The currently selected points are given a visually distinctive style, and
  you can modify your selection by either clicking on individual points or
  drawing a lasso around new points.
  
  When the shift key is pressed, new selections are added to the selected
  set, or subtracted if the new selection is a subset of the current
  selection.
  
  Args:
      collection: a ``matplotlib.collections.Collection`` to select points
          from
      ids (None): an array-like of IDs corresponding to the points in
          ``collection``
      buttons (None): a list of ``(label, icon_image, callback)`` tuples
          defining buttons to add to the plot
      alpha_other (0.25): a transparency value for unselected points
      expand_selected (3.0): expand the size of selected points by this
          multiple
      click_tolerance (0.02): a click distance tolerance in ``[0, 1]`` when
          clicking individual points
      **kwargs: keyword arguments for the
          :class:`fiftyone.core.plots.base.InteractivePlot` constructor
class_docstr_tok: ["Interactive","wrapper","for","a","matplotlib","collection",".","This","class","enables","collection","points","to","be","lasso-ed","and","click","selected",".","The","currently","selected","points","are","given","a","visually","distinctive","style",",","and","you","can","modify","your","selection","by","either","clicking","on","individual","points","or","drawing","a","lasso","around","new","points",".","When","the","shift","key","is","pressed",",","new","selections","are","added","to","the","selected","set",",","or","subtracted","if","the","new","selection","is","a","subset","of","the","current","selection",".","Args",":","collection",":","a","``","matplotlib.collections.Collection","``","to","select","points","from","ids","(","None",")",":","an","array-like","of","IDs","corresponding","to","the","points","in","``","collection","``","buttons","(","None",")",":","a","list","of","``","(","label",",","icon_image",",","callback",")","``","tuples","defining","buttons","to","add","to","the","plot","alpha_other","(","0.25",")",":","a","transparency","value","for","unselected","points","expand_selected","(","3.0",")",":","expand","the","size","of","selected","points","by","this","multiple","click_tolerance","(","0.02",")",":","a","click","distance","tolerance","in","``","[","0",",","1","]","``","when","clicking","individual","points","*","*","kwargs",":","keyword","arguments","for","the",":","class",":","`","fiftyone.core.plots.base.InteractivePlot","`","constructor"]
code: def _on_select(self, vertices):
      x1, x2 = self.ax.get_xlim()
      y1, y2 = self.ax.get_ylim()
      click_thresh = self.click_tolerance * min(
          abs(x2 - x1), abs(y2 - y1)
      )
  
      is_click = np.abs(np.diff(vertices, axis=0)).sum() < click_thresh
  
      if is_click:
          dists = skp.euclidean_distances(
              self._xy, np.array([vertices[0]])
          )
          click_ind = np.argmin(dists)
          if dists[click_ind] < click_thresh:
              inds = [click_ind]
          else:
              inds = []
  
          inds = np.array(inds, dtype=int)
      else:
          path = Path(vertices)
          inds = np.nonzero(path.contains_points(self._xy))[0]
  
      curr_inds = self._inds
      if curr_inds is None:
          curr_inds = np.array([], dtype=int)
  
      if self._shift:
          new_inds = set(inds)
          inds = set(curr_inds)
          if new_inds.issubset(inds):
              # The new selection is a subset of the current selection, so
              # remove the selection
              inds.difference_update(new_inds)
          else:
              # The new selection contains new points, so add them
              inds.update(new_inds)
  
          inds = np.array(sorted(inds), dtype=int)
      else:
          inds = np.unique(inds)
  
      if inds.size == curr_inds.size and np.all(inds == curr_inds):
          # Selection hasn't changed
          self._draw()
          return
  
      if not inds.size:
          inds = None
  
      self._select_inds(inds)
  
imports: import itertools
  import logging
  import numpy
  import matplotlib
  from matplotlib.widgets import Button, LassoSelector
  from matplotlib.path import Path
  import matplotlib.pyplot
  from mpl_toolkits.axes_grid1 import make_axes_locatable
  from mpl_toolkits.axes_grid1.inset_locator import InsetPosition
  from mpl_toolkits.mplot3d import Axes3D
  import sklearn.metrics.pairwise
  import sklearn.metrics
  import eta.core.utils
  import fiftyone.core.context
  import fiftyone.core.utils
  from .base import InteractivePlot
  from .utils import best_fit_line, load_button_icon, parse_lines_inputs, parse_locations, parse_scatter_inputs
label_desc: Use image node_id 19 for calling the InteractiveCollection obj's underlying member method code with example usage: obj._on_select(vertices) without return types