code: def test_subscriber_query_events():
      subscriber = DummySubscriber()
  
      ev1 = EventRecord(
          interface_class=DummyInterface,
          interface_method=DummyInterface.event1,
          attributes=dict(),
      )
      subscriber.notify_event(ev1)
  
      assert [ev1] == subscriber.query_events(
          event_spec=DummyInterface.event1
      )
  
      subscriber.reset()
  
      assert (
          subscriber.query_events(event_spec=DummyInterface.event1)
          == []
      )
  
file_path: maze/maze/test/core/test_pubsub.py
imports: from abc import ABC
  from typing import List, Type
  import pytest
  from maze.core.events.event_service import EventService
  from maze.core.events.event_record import EventRecord
  from maze.core.events.pubsub import Pubsub, Subscriber
label_desc: Use image node_id 3 for calling a global function with example usage: test_subscriber_query_events() without return types