code: def register_listener(self, name: str, listener: Callable[[Event], None], priority: int=5) -> None:
          
          self._event_manager.register_listener(name, listener, priority)
docs: Registers a callable as a listener to a events with the given name.
  
          The listening callable will be called with a named ``Event`` as it's only argument any time the
          event emitter is invoked from somewhere in the simulation.
  
          The framework creates the following events and emits them at different points in the simulation:
              At the end of the setup phase: ``post_setup``
              Every time step: ``time_step__prepare``, ``time_step``, ``time_step__cleanup``, ``collect_metrics``
              At simulation end: ``simulation_end``
  
          Parameters
          ----------
          name :
              The name of the event to listen for.
          listener :
              The callable to be invoked any time an ``Event`` with the given name is emitted.
          priority : {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
              An indication of the order in which event listeners should be called. Listeners with
              smaller priority values will be called earlier. Listeners with the same priority have
              no guaranteed ordering.  This feature should be avoided if possible. Components should
              strive to obey the Markov property as they transform the state table (the state of the simulation
              at the beginning of the next time step should only depend on the current state of the system).