class_docstr: A collection of EventRecord instances that can be queried by event specification.
docstr: Return all events collected at the current env step matching one or more given event types. The event
      types are specified by the interface member function object itself.
  
      Event calls are recorded as EventRecord, an object providing access to the passed arguments of the event
      method.
  
  :param event_spec:  Specifies the event type by the interface member function. Can either be a single event
                      type specification or a list of specifications.
  :return:            An iterable to the event objects.
docstr_tok: ["Return","all","events","collected","at","the","current","env","step","matching","one","or","more","given","event","types",".","The","event","types","are","specified","by","the","interface","member","function","object","itself",".","Event","calls","are","recorded","as","EventRecord",",","an","object","providing","access","to","the","passed","arguments","of","the","event","method",".",":","param","event_spec",":","Specifies","the","event","type","by","the","interface","member","function",".","Can","either","be","a","single","event","type","specification","or","a","list","of","specifications",".",":","return",":","An","iterable","to","the","event","objects","."]
code: def query_events(
      self, event_spec: Union[Callable, Iterable[Callable]]
  ) -> Iterable:
      """Return all events collected at the current env step matching one or more given event types. The event
          types are specified by the interface member function object itself.
  
          Event calls are recorded as EventRecord, an object providing access to the passed arguments of the event
          method.
  
      :param event_spec:  Specifies the event type by the interface member function. Can either be a single event
                          type specification or a list of specifications.
      :return:            An iterable to the event objects.
      """
  
      # normalize event specification, convert to a list with a single item if necessary
      if not isinstance(event_spec, Iterable):
          event_spec = [event_spec]
  
      return [
          event
          for event in self.events
          if event.interface_method in event_spec
      ]
  
file_path: maze/maze/core/events/event_collection.py
imports: from collections import deque
  from typing import Callable, Iterable, MutableSequence, Union
  from maze.core.events.event_service import EventRecord
label_desc: Use image node_id 4 for calling the EventCollection obj's underlying member method code with example usage: obj.query_events(event_spec) and returns: unknown