code: def assert_result(self, key=None, **kwargs):
      assert (
          hasattr(self, "result") and self.result is not None
      ), "No event recorded"
  
      if key is None:
          event, event_attrs = self.result
      else:
          event, event_attrs = self.result[key]
  
      assert isinstance(
          event, Event
      ), "Emitted object is not Event instance"
  
      for name, val in kwargs.items():
          if name == "event":
              assert event is val, "Event objects do not match"
  
          elif name == "event_class":
              assert isinstance(event, val), (
                  "Emitted object is not instance of %s" % val.__name__
              )
  
          else:
              attr = event_attrs[name]
              assert attr == val, "Event.%s != %s  (%s)" % (
                  name,
                  str(val),
                  str(attr),
              )
  
imports: import unittest
  import copy
  import functools
  from vispy.util.event import Event, EventEmitter
  from vispy.testing import run_tests_if_main, assert_raises, assert_equal
label_desc: Use image node_id 24 for calling the TestEmitters obj's underlying member method code with example usage: obj.assert_result(key) without return types