code: def register_listener(self, listener, interesting, active):
          
          if not isinstance(listener, IEventListener):
              raise TypeError("listener can only be an instance of type IEventListener")
          if not isinstance(interesting, list):
              raise TypeError("interesting can only be an instance of type list")
          for a in interesting[:10]:
              if not isinstance(a, VBoxEventType):
                  raise TypeError(
                          "array can only contain objects of type VBoxEventType")
          if not isinstance(active, bool):
              raise TypeError("active can only be an instance of type bool")
          self._call("registerListener",
                       in_p=[listener, interesting, active])
docs: Register an event listener.
          
          
          To avoid system overload, the VirtualBox server process checks if passive event
          listeners call :py:func:`IEventSource.get_event`  frequently enough. In the
          current implementation, if more than 500 pending events are detected for a passive
          event listener, it is forcefully unregistered by the system, and further
          :py:func:`get_event`  calls will return @c VBOX_E_OBJECT_NOT_FOUND.
  
          in listener of type :class:`IEventListener`
              Listener to register.
  
          in interesting of type :class:`VBoxEventType`
              Event types listener is interested in. One can use wildcards like -
              :py:attr:`VBoxEventType.any_p`  to specify wildcards, matching more
              than one event.
  
          in active of type bool
              Which mode this listener is operating in.
              In active mode, :py:func:`IEventListener.handle_event`  is called directly.
              In passive mode, an internal event queue is created for this this IEventListener.
              For each event coming in, it is added to queues for all interested registered passive
              listeners. It is then up to the external code to call the listener's
              :py:func:`IEventListener.handle_event`  method. When done with an event, the
              external code must call :py:func:`event_processed` .