def event_handlers():
 all_handlers = defaultdict(list)
 for plugin in find_plugins():
  if plugin.listeners:
   for (event, handlers) in plugin.listeners.items():
    all_handlers[event] += handlers
 return all_handlers

def event_handlers ( ) : all_handlers = defaultdict ( list ) for plugin in find_plugins ( ) : if plugin . listeners : for ( event , handlers ) in plugin . listeners . items ( ) : all_handlers [ event ] += handlers return all_handlers
find all event handlers from plugins as a dictionary mapping event names to sequences of callables .