code: def main_callback(self, *args, **kwargs):
          
          if not self.callback:
              raise NotImplementedError('Entrypoints must declare `callback`')
          if not self.settings:
              raise NotImplementedError('Entrypoints must declare `settings`')
  
          self.callback.im_self.db = None
  
          #1. Start all the middlewares
          with self.debug(*args, **kwargs):
              with self.database():
                  #2. `Real` callback
                  result = self.callback(*args, **kwargs)#pylint: disable=not-callable
          return result
docs: Main callback called when an event is received from an entry point.
  
          :returns: The entry point's callback.
          :rtype: function
          :raises NotImplementedError: When the entrypoint doesn't have the required attributes.