'Returns the next query result.'

def next(self):

    while ((not self.__current_batch) or (self.__current_pos >= len(self.__current_batch.results))):
        try:
            next_batch = self.__batcher.next_batch(Batcher.AT_LEAST_OFFSET)
        except:
            if self.__current_batch:
                self.__last_cursor = self.__current_batch.end_cursor
            raise
        self.__current_pos = 0
        self.__current_batch = next_batch
    result = self.__current_batch.results[self.__current_pos]
    self.__current_pos += 1
    return result
