code: def on_mouse_move(event):
      global pointer, px, py
  
      pp = event.pos
  
      # Optimization: to avoid too much recalculation/update we can update scene only if the mouse
      # moved a certain amount of pixel.
      if (
          abs(px - pp[0]) > MIN_MOVE_UPDATE_THRESHOLD
          or abs(py - pp[1]) > MIN_MOVE_UPDATE_THRESHOLD
      ):
          pointer.center = pp
          if event.button == 1:
              polygon_vertices = event.trail()
              lasso.set_data(
                  pos=np.insert(
                      polygon_vertices,
                      len(polygon_vertices),
                      polygon_vertices[0],
                      axis=0,
                  )
              )
              px, py = pp
  
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 4 for calling a global function with example usage: on_mouse_move(event) without return types