code: def on_mouse_move(event):
      global throttle
      # throttle mouse events to 50ms
      if time.monotonic() - throttle < 0.05:
          return
      throttle = time.monotonic()
  
      # adjust the event position for hidpi screens
      render_size = tuple(d * canvas.pixel_scale for d in canvas.size)
      x_pos = event.pos[0] * canvas.pixel_scale
      y_pos = render_size[1] - (event.pos[1] * canvas.pixel_scale)
  
      # render a small patch around the mouse cursor
      restore_state = not picking_filter.enabled
      picking_filter.enabled = True
      markers.update_gl_state(blend=False)
      picking_render = canvas.render(
          crop=(x_pos - 2, y_pos - 2, 5, 5),
          bgcolor=(0, 0, 0, 0),
          alpha=True,
      )
      if restore_state:
          picking_filter.enabled = False
      markers.update_gl_state(blend=not picking_filter.enabled)
  
      # unpack the face index from the color in the center pixel
      marker_idx = (picking_render.view(np.uint32) - 1)[2, 2, 0]
  
      if marker_idx >= 0 and marker_idx < len(pos):
          new_symbols = list(markers.symbol)
          new_symbol = symbols_ring[new_symbols[marker_idx]]
          new_symbols[marker_idx] = new_symbol
  
          colors[marker_idx] = random.choice(COLORS)
          markers.set_data(
              pos=pos,
              edge_color=EDGE_COLOR,
              face_color=colors,
              size=MARKER_SIZE,
              edge_width=EDGE_WDITH,
              symbol=new_symbols,
          )
  
file_path: vispy/examples/scene/marker_picking.py
imports: import random
  import time
  import numpy
  from scipy.constants import golden
  from vispy import app, scene
  from vispy.scene.visuals import Markers
  from vispy.visuals.filters import MarkerPickingFilter
label_desc: Use image node_id 2 for calling a global function with example usage: on_mouse_move(event) without return types