def __next__(self):
        """iterate over the available events"""
        self._currItem += 1
        # if we want to return only the first X items, then finish once reached
        if self._maxItems >= 0 and self._currItem > self._maxItems:
            raise StopIteration
        if len(self._eventList) == 0:
            self._getNextEventBatch()
        if len(self._eventList) > 0:
            return self._eventList.pop(0)
        raise StopIteration
def __next__ ( self ) : self . _currItem += 1 if self . _maxItems >= 0 and self . _currItem > self . _maxItems : raise StopIteration if len ( self . _eventList ) == 0 : self . _getNextEventBatch ( ) if len ( self . _eventList ) > 0 : return self . _eventList . pop ( 0 ) raise StopIteration
iterate over the available events