Goes one item ahead and returns it.
514501
def next(self):
        """"""
        rv = self.current
        self.pos = (self.pos + 1) % len(self.items)
        return rv
1048831
def primitive(self):
        """"""
        primitive = copy(self.item.primitive)
        primitive.update(self.entry.primitive)
        return primitive
480899
def get_single_item(d):
    """"""
    assert len(d) == 1, 'Single-item dict must have just one item, not %d.' % len(d)
    return next(six.iteritems(d))
242920
def one_of(self, items):
        
        return self._generate_test(
            lambda value: value in items,
            ('one_of', self._path, freeze(items))
        )
1161400
def find_one(self, cls, id):
        """"""
        one = self._find(cls, {"_id": id})
        if not one:
            return None
        return one[0]
1291751
def check_order(self, order):
    
    own_order = self.order
    for item in order:
      if item not in own_order:
        raise ValueError(f'Order item {item} not found.')
    return order
609066
function (item, state) {
                var
                    nextItem = this._getItem(state, state.index + 1),
                    optional;
                if (this._choice && -1 < state.choice) {
                    optional = this._optionals[state.choice];
                } else {
                    optional = this._optionals[0];
                }
                ++state.count;
                if (0 === item.max()) {
                    // Unlimited
                    this._reset(item, state);
                    if (null !== nextItem && optional > state.index) {
                        return PatternItem.WRITE_NEED_DATA;
                    } else {
                        // Last (or equivalent) so...
                        return PatternItem.WRITE_MATCH;
                    }
                } else if (state.count === item.max()) {
                    if (null === nextItem) {
                        return PatternItem.WRITE_FINAL_MATCH;
                    }
                    ++state.index;
                    this._reset(nextItem, state);
                    if (optional <= state.index) {
                        return PatternItem.WRITE_MATCH;
                    }
                }
                return PatternItem.WRITE_NEED_DATA;
            }
978517
def addfirst(self, item, new_priority=None):
        """"""

        with self.lock:

            self_data = self.data

            try:
                priority = self_data[0][1]
                if new_priority is not None:
                    if new_priority < priority:
                        raise ValueError('Priority must be >= '
                                         'highest priority.')
                    else:
                        priority = new_priority
            except IndexError:
                priority = 0 if new_priority is None else new_priority

            self_data.appendleft((item, priority))
            self_items = self.items
            maxlen = self._maxlen

            try:
                self_items[item] += 1
            except TypeError:
                self_items[repr(item)] += 1

            if maxlen is not None and maxlen < len(self_data):
                self._poplast()
456521
async function onetime() {
    if (called) return value;

    called = 1;
    value = await fn.apply(this, arguments);
    fn = null;

    return value;
  }
563938
def __return(self, shard_state, tstate, task_directive):
    """"""
    task_directive = self._set_state(shard_state, tstate, task_directive)
    self._save_state_and_schedule_next(shard_state, tstate, task_directive)
    context.Context._set(None)
533796
def skip_first(pipe, items=1):
    ''' 
    '''
    pipe = iter(pipe)
    for i in skip(pipe, items):
        yield i
269344
def recurse(self, fn, *args):
        """"""
        fn(self, *args)
        for i in self.items:
            if isinstance(i, Hypercat):
                self.recurse(i, *args)
1304522
def next(self):
        """"""
        item = six.next(self._item_iter)
        result = self._item_to_value(self._parent, item)
        # Since we've successfully got the next value from the
        # iterator, we update the number of remaining.
        self._remaining -= 1
        return result
1266254
def this_and_prev(iterable):
    """"""
    try:
        item = next(iterable)
        while True:
            next_item = next(iterable)
            yield item, next_item
            item = next_item
    except StopIteration:
        return
1209779
def move_item_up(self, item):
        
        prev_iter = self._prev_iter_for(item)
        if prev_iter is not None:
            self.model.swap(prev_iter, self._iter_for(item))
210133
def MI_get_item(self, key, index=0):
    ''
    index = _key_to_index_single(force_list(self.indices.keys()), index)
    if index != 0:
        key = self.indices[index][key]  # always use first index key
    # key must exist
    value = super(MIMapping, self).__getitem__(key)
    N = len(self.indices)
    if N == 1:
        return [key]

    if N == 2:
        value = [value]
    return [key] + value
232605
def heappushpop(heap, item):
    """"""
    if heap and heap[0] < item:
        item, heap[0] = heap[0], item
        _siftup(heap, 0)
    return item