Return the item that will be next returned from ``next()``.

        Return ``default`` if there are no items left. If ``default`` is not
        provided, raise ``StopIteration``.
777674
def peek(self, default=_marker):
        
        if not hasattr(self, '_peek'):
            try:
                self._peek = next(self._it)
            except StopIteration:
                if default is _marker:
                    raise
                return default
        return self._peek
143682
def first(self, callback=None, default=None):
        
        if callback is not None:
            for val in self.items:
                if callback(val):
                    return val

            return value(default)

        if len(self.items) > 0:
            return self.items[0]
        else:
            return default
400227
def item_after(self, item):
        
        next_iter = self._next_iter_for(item)
        if next_iter is not None:
            return self._object_at_iter(next_iter)
553122
def next(self):
        
        if self._cur_col >= len(self._rec):
            self._cur_col = 0
            raise StopIteration
        col = self._rec[self._cur_col]
        self._cur_col += 1
        return col
329419
def get_next_batch(self):
        
        if self.iterator is None:
            self.iterator = self.iteritems()

        count = 0
        while count < self.batch_size:
            count += 1
            yield next(self.iterator)
        self.logger.debug('Done reading batch')
632370
def next(self):
        
        if self.current_token == len(self.tokens):
            return None
        token = self.tokens[self.current_token]
        if token["type"] == "newline":
            self.line += 1
            self.line_start = token["start"]
        self.current_token += 1
        if token["type"] == "unknown":
            self.error("Unknown token")
        return token
997976
def next(self):
        
        if self.index < self.length:
            index = self.index
            self.index += 1
            return self.rules[index]
        else:
            raise StopIteration()
569030
def do_last(environment, seq):
    """"""
    try:
        return next(iter(reversed(seq)))
    except StopIteration:
        return environment.undefined('No last item, sequence was empty.')
563229
def next(self):
        """"""
        if self.__tailable:
            return PymongoCursor.next(self)
        try:
            ret = PymongoCursor.next(self)
        except StopIteration:
            self.__fullcache = True
            raise
        self.__itercache.append(ret)
        return ret
372822
def next(self):
        
        if self.iter_next():
            return DataBatch(data=self.getdata(), label=self.getlabel(), \
                    pad=self.getpad(), index=self.getindex())
        else:
            raise StopIteration
98575
def next(self):
        
        if self.idx >= len(self.page_list):
            raise StopIteration()
        page = self.page_list[self.idx]
        self.idx += 1
        return page
585038
def peek(self, default=None):
        ''''''
        try:
            result = self.pointer.next()
            # immediately push it back onto the front of the iterable
            self.pointer = itertools.chain([result], self.pointer)
            return result
        except StopIteration:
            # nothing to put back; iterating doesn't change anything past the end
            return default
656702
def next(self):
        
        try:
            self.event, self.element = next(self.iterator)
            self.elementTag = clearTag(self.element.tag)
        except StopIteration:
            clearParsedElements(self.element)
            raise StopIteration
        return self.event, self.element, self.elementTag
195458
def next_chunk(self):
        
        if self._unconsumed:
            data = self._unconsumed.pop()
        else:
            data = self._iterator.next()  # Might raise StopIteration
        self._pos += len(data)
        return data
1189083
function next() {
        // Exit if all iterators are traversed.
        if (empties.size === count) {
            return done;
        }

        // Go to the next iterator.
        const iter = step();

        const res = iter.next();

        // Mark iterator as empty and go to the next.
        if (res.done) {
            empties.add(index);

            return next();
        }

        return res;
    }
680259
def find_one(self, *args, **kwargs):
        
        try:
            return next(self.find(*args, **kwargs))
        except StopIteration:
            return None
1147018
def returns(self) -> T.Optional[DocstringReturns]:
        """"""
        try:
            return next(
                DocstringReturns.from_meta(meta)
                for meta in self.meta
                if meta.args[0] in {"return", "returns", "yield", "yields"}
            )
        except StopIteration:
            return None