docs: def validate_commit_index(func):
      """Apply to State Machine everything up to commit index"""
  
      @functools.wraps(func)
      def wrapped(self, *args, **kwargs):
          for not_applied in range(self.log.last_applied + 1, self.log.commit_index + 1):
              self.state_machine.apply(self.log[not_applied]['command'])
              self.log.last_applied += 1
  
              try:
                  self.apply_future.set_result(not_applied)
              except (asyncio.futures.InvalidStateError, AttributeError):
                  pass
  
          return func(self, *args, **kwargs)
      return wrapped