code: def _emit(self, event, document, *args, **kwargs):
          
          self.handler_registrar().apply(event, document, *args, **kwargs)
docs: Inner version of emit which passes the given document as the
          primary argument to handler functions.