def dispatch_event(self, event):
        """
        Dispatch an instance of Event class
        """
        # Dispatch the event to all the associated listeners 
        if event.type in self._events.keys():
            listeners = self._events[ event.type ]
            
            for listener in listeners:
                listener( event )

        Dispatch an instance of Event class
        
recipes/Python/577432_Simple_event_dispatcher/recipe-577432.py