Pessimistically find the next key in the index after an eof condition.
498628
private void pessimisticSearchNext(
                                      DeleteStack    stack)
    {
        synchronized(_index)
        {
            internalSearchNext(stack, _index.vno(), _index.xno());
            _pessimisticSearchNexts++;
        }
    }
595127
private int find(int key, int hash) {
        int index = index(hash);
        final int maxTry = capacity;
        for (int i = 0; i < maxTry; i++) {
            Object slot = values[index];
            if (slot == null) return -1;
            if (slot != GUARD) return keys[index] == key ? index : -1;
            index = nextIndex(index);
        }
        return -1;
    }
706435
def eol_distance_next(self, offset=0):
        """"""
        distance = 0
        for char in self.string[self.pos + offset:]:
            if char == '\n':
                break
            else:
                distance += 1
        return distance
1111405
private void pessimisticFind(
                                SearchComparator  comp,
                                Object            searchKey,
                                SearchNode        point)
    {
        point.reset();

        synchronized(this)
        {
            internalFind(comp, searchKey, point);
            _pessimisticFinds++;
        }
    }
108127
def _find_corresponding_multicol_key(key, keys_multicol):
    """"""
    for mk in keys_multicol:
        if key.startswith(mk) and 'of' in key:
            return mk
    return None
770057
def _get_key_location(self, key) -> (int, int):
        
        key = int(key)
        if key == 0:
            return 1, 0
        remainder = key % self.chunkSize
        addend = ChunkedFileStore.firstChunkIndex
        chunk_no = key - remainder + addend if remainder \
            else key - self.chunkSize + addend
        offset = remainder or self.chunkSize
        return chunk_no, offset
317860
def get_value(self, series, key):
        """"""
        if np.asarray(key).dtype == np.dtype(bool):
            return series.iloc[key]
        elif isinstance(key, slice):
            return series.iloc[self.slice_indexer(
                key.start, key.stop, key.step)]
        else:
            return series.iloc[self.get_loc(key)]
1135858
private void ensureNext() {
        // Check if the current scan result has more keys (i.e. the index did not reach the end of the result list)
        if (resultIndex < scanResult.getResult().size()) {
            return;
        }
        // Since the current scan result was fully iterated,
        // if there is another cursor scan it and ensure next key (recursively)
        if (!FIRST_CURSOR.equals(scanResult.getStringCursor())) {
            scanResult = scan(scanResult.getStringCursor(), scanParams);
            resultIndex = 0;
            ensureNext();
        }
    }
1316689
private int indexOf(int key) {
		int startIndex = hashIndex(key);
		int index = startIndex;

		for (;;) {
			if (values[index] == null) {
				// It's available, so no chance that this value exists anywhere in the map.
				return -1;
			}
			if (key == keys[index]) {
				return index;
			}

			// Conflict, keep probing ...
			if ((index = probeNext(index)) == startIndex) {
				return -1;
			}
		}
	}
941712
def next_index(self) -> int:
        """"""
        return bisect.bisect_right(self.totals, random.random() * self.total)
268039
def next(self):
        """"""
        if self._current_index < len(self._collection):
            value = self._collection[self._current_index]
            self._current_index += 1
            return value
        elif self._next_cursor:
            self.__fetch_next()
            return self.next()
        else:
            self._current_index = 0
            raise StopIteration
1185848
private Long next(long t) {
        SortedMap<Long, int[]> x = data.tailMap(t + 1);
        return x.isEmpty() ? null : x.firstKey();
    }
803649
def at_index(iterable, index):
    # type: (Iterable[T], int) -> T
    "
    try:
        if index < 0:
            return deque(iterable, maxlen=abs(index)).popleft()

        return next(itertools.islice(iterable, index, index + 1))
    except (StopIteration, IndexError) as e:
        raise_from(IndexError('Index "%d" out of range' % index), e)
1036282
private int findIndex(Object key, Object[] array) {
        int length = array.length;
        int index = getModuloHash(key, length);
        int last = (index + length - 1) % length;
        while (index != last) {
            if (array[index] == key || array[index] == null) {
                /*
                 * Found the key, or the next empty spot (which means key is not
                 * in the table)
                 */
                break;
            }
            index = (index + 1) % length;
        }
        return index;
    }
1233750
def _next_offset(self):
    """"""
    if self._filestream:
      offset = self._filestream.tell()
      if offset:
        offset -= 1
    else:
      offset = self._initial_offset

    return offset
982785
def indexOf(self, pattern, start_idx, bitlength):
        
        return StrIndexOf(self, pattern, start_idx, bitlength)
754123
def find_next(lines, find_str, start_index):
    
    mode = None
    if isinstance(find_str, basestring):
        mode = 'normal'
        message = find_str
    elif isinstance(find_str, Invert):
        mode = 'invert'
        message = str(find_str)
    else:
        raise TypeError("Unsupported message type")
    for i in range(start_index, len(lines)):
        if re.search(message, lines[i]):
            return mode == 'normal', i, lines[i]
        elif message in lines[i]:
            return mode == 'normal', i, lines[i]
    if mode == 'invert':
        return True, len(lines), None
    raise LookupError("Not found")