code: def _call_event(self, event_name, cmd, pargs, kwargs, **kws):
          
          def get_result_params(res):
              """return the right list of params"""
              if not isinstance(res, (list, tuple)):
                  return res, pargs, kwargs
              elif len(res) == 2:
                  return res, pargs, kwargs
              return res[0], (pargs[0], ) + tuple(res[1]), kwargs
          if hasattr(cmd, event_name):
              return get_result_params(
                  getattr(cmd, event_name)(pargs[0], *pargs[1:], **kwargs))
          elif hasattr(cmd.__cls__, event_name):
              return get_result_params(
                  getattr(cmd.__cls__, event_name)(
                      pargs[0], cmd.__cmd_name__ or cmd.__name__, *pargs[1:],
                      **kwargs))
          return None, pargs, kwargs
docs: Try to call events for cmd.