code: def test_mouse_key_events():
      """Test mouse and key events"""
      me = MouseEvent("mouse_press")
      for fun in (
          me.pos,
          me.button,
          me.buttons,
          me.modifiers,
          me.delta,
          me.press_event,
          me.last_event,
          me.is_dragging,
      ):
          fun
      me.drag_events()
      me._forget_last_event()
      me.trail()
      ke = KeyEvent("key_release")
      ke.key
      ke.text
      ke.modifiers
  
imports: import sys
  from collections import namedtuple
  from io import StringIO
  from time import sleep
  import gc
  import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from vispy.app import use_app, Canvas, Timer, MouseEvent, KeyEvent
  from vispy.app.base import BaseApplicationBackend
  from vispy.testing import requires_application, SkipTest, assert_is, assert_in, run_tests_if_main, assert_equal, assert_true, assert_raises, IS_TRAVIS_CI
  from vispy.util import keys, use_log_level
  from vispy.gloo.program import Program, VertexBuffer, IndexBuffer
  from vispy.gloo.util import _screenshot
  from vispy.gloo import gl
label_desc: Use image node_id 12 for calling a global function with example usage: test_mouse_key_events() without return types