code: def _trigger_event(self, event, namespace, *args):
          
          # first see if we have an explicit handler for the event
          if namespace in self.handlers and event in self.handlers[namespace]:
              return self.handlers[namespace][event](*args)
  
          # or else, forward the event to a namespace handler if one exists
          elif namespace in self.namespace_handlers:
              return self.namespace_handlers[namespace].trigger_event(
                  event, *args)
docs: Invoke an application event handler.