code: def spatial_geom_select(x0vals, y0vals, x1vals, y1vals, geometry):
      try:
          from shapely.geometry import Polygon, box
  
          boxes = (
              box(x0, y0, x1, y1)
              for x0, y0, x1, y1 in zip(x0vals, y0vals, x1vals, y1vals)
          )
          poly = Polygon(geometry)
          return np.array([poly.contains(p) for p in boxes])
      except ImportError:
          raise ImportError(
              "Lasso selection on geometry data requires "
              "shapely to be available."
          ) from None
  
imports: import sys
  import numpy
  import pandas
  from ..core import Dataset, NdOverlay, util
  from ..streams import Lasso, Selection1D, SelectionXY
  from ..util.transform import dim
  from .annotation import HSpan, VSpan
label_desc: Use image node_id 4 for calling a global function with example usage: spatial_geom_select(x0vals, y0vals, x1vals, y1vals, geometry) and returns: np