code: def select(polygon_vertices, points):
      # Set default mask to filter everything since user selection
      # is not yet calculated.
      selected_mask = np.full((NUMBER_POINT, 4), FILTERED_COLOR)
  
      if polygon_vertices is not None:
          # Optimization: It's faster to convert lasso selection straight to visual coordinates since there's generally less vertices
          # this would speed up the processing depending on the scene.
          polygon_vertices = scatter.get_transform(
              "canvas", "visual"
          ).map(polygon_vertices)
          selected_mask = points_in_polygon(polygon_vertices, points)
  
      return selected_mask
  
file_path: vispy/examples/scene/lasso.py
imports: import sys
  import warnings
  import numpy
  from vispy import app, scene
  from vispy.geometry import curves
  from vispy.scene import visuals
label_desc: Use image node_id 2 for calling a global function with example usage: select(polygon_vertices, points) and returns: selected_mask