Move cursor to next (prev if reverse) row for which func returns True.  Returns False if no row meets the criteria.
977599
def moveToNextRow(vs, func, reverse=False):
    ''
    rng = range(vs.cursorRowIndex-1, -1, -1) if reverse else range(vs.cursorRowIndex+1, vs.nRows)

    for i in rng:
        try:
            if func(vs.rows[i]):
                vs.cursorRowIndex = i
                return True
        except Exception:
            pass

    return False
307388
def move_cursor(row = nil)
      if row
        if (prev_item = items[current_row])
          main.draw_item prev_item
        end
        page = row / max_items
        switch_page page if page != current_page
        main.activate_pane row / maxy
        @current_row = row
      else
        @current_row = 0
      end

      item = items[current_row]
      main.draw_item item, current: true
      main.display current_page

      header_l.draw_current_file_info item
      @current_row
    end
370559
private void moveCursorToNextLine() {
        cursorPosition = cursorPosition.withColumn(0).withRelativeRow(1);
        if(cursorPosition.getRow() >= currentTextBuffer.getLineCount()) {
            currentTextBuffer.newLine();
        }
        trimBufferBacklog();
        correctCursor();
    }
1356305
public function next()
    {
        $cursor = $this;
        $this->retry(function() use ($cursor) {
            $cursor->getMongoCursor()->next();
        }, false);
    }
244302
def previous_row(self):
        """"""
        row = self.currentIndex().row()
        rows = self.source_model.rowCount()
        if row == 0:
            row = rows
        self.selectRow(row - 1)
893129
@Override
    public boolean next() {
        if (pointer < rows.size() && pointer + 1 != rows.size()) {
            pointer++;
            currentRecord = new RowRecord(rows.get(pointer), metaData, parser.isColumnNamesCaseSensitive(), pzConvertProps, strictNumericParse,
                    upperCase, lowerCase, parser.isNullEmptyStrings());
            return true;
        }
        currentRecord = null;
        return false;
    }
1370063
def _cursor_back(self, value):
        
        if value <= 0:
            value = 1
        self._cursor.movePosition(self._cursor.Left, self._cursor.MoveAnchor, value)
        self._text_edit.setTextCursor(self._cursor)
        self._last_cursor_pos = self._cursor.position()
939618
boolean first(RowCursor minCursor, 
                RowCursor resultCursor, 
                boolean isMatch)
  {
    int ptr = _rowHead;
    int rowLength = resultCursor.length();
    int removeLength = resultCursor.removeLength();
    int sortOffset = _rowSortHead;
    
    byte []buffer = _buffer;

    while (ptr < sortOffset) {
      int code = buffer[ptr] & CODE_MASK;
      
      int minCmp;
      int cmp;

      switch (code) {
      case INSERT:
        if ((minCmp = minCursor.compareKeyRow(buffer, ptr)) <= 0
            && ((cmp = resultCursor.compareKeyRow(buffer, ptr)) > 0
                || cmp == 0 && ! isMatch)) {
          fillMatch(ptr, resultCursor);
          
          if (minCmp == 0) {
            return true;
          }
          
          isMatch = true;
        }

        ptr += rowLength;
        break;
        
      case INSERT_DEAD:
        ptr += rowLength;
        break;
        
      case REMOVE:
        if ((minCmp = minCursor.compareKeyRemove(buffer, ptr)) <= 0
            && ((cmp = resultCursor.compareKeyRemove(buffer, ptr)) > 0
                || cmp == 0 && ! isMatch)) {
          resultCursor.setRemove(buffer, ptr);
          //resultCursor.setKey(buffer, ptr + 1);
          
          if (minCmp == 0) {
            return true;
          }
          
          isMatch = true;
        }

        ptr += removeLength;
        break;
        
      default:
        System.out.println("BROKEN_ENTRY:");
        return false;
      }
    }

    if (sortOffset < BLOCK_SIZE) {
      return findFirstSorted(minCursor, resultCursor, isMatch);
    }
    else {
      return isMatch;
    }
  }
1195935
function next(cursor, callback) {
  // Return the currentDoc if someone called hasNext first
  if (cursor.s.currentDoc) {
    const doc = cursor.s.currentDoc;
    cursor.s.currentDoc = null;
    return callback(null, doc);
  }

  // Return the next object
  nextObject(cursor, callback);
}
79748
def move_cursor(self, chars=0):
        """"""
        direction = QTextCursor.Right if chars > 0 else QTextCursor.Left
        for _i in range(abs(chars)):
            self.moveCursor(direction, QTextCursor.MoveAnchor)
685303
def next_row(self):
        """"""
        if self.mode == self.SYMBOL_MODE:
            self.select_row(+1)
            return
        next_row = self.current_row() + 1
        if next_row < self.count():
            if '</b></big><br>' in self.list.item(next_row).text():
                # Select the next next row, the one following is a title
                self.select_row(+2)
            else:
                self.select_row(+1)
887098
def _cursor_forward(self, value):
        
        if value <= 0:
            value = 1
        self._cursor.movePosition(self._cursor.Right, self._cursor.MoveAnchor, value)
        self._text_edit.setTextCursor(self._cursor)
        self._last_cursor_pos = self._cursor.position()
45122
def goto_prev_selection
      return if selected_rows().length == 0 
      row = selected_rows().sort{|a,b| b <=> a}.find { |i| i < @obj.current_index }
      row ||= @obj.current_index
      #@obj.current_index = row
      @obj.goto_line row
    end
858833
@Override
    public boolean next() throws SQLException {
        notClosed();
        if (!this.hasNext()) {
            this.row = null;
            this.currentValue = null;
            return false;
        }

        this.row = rowIter.nextRow();
        return true;
    }
329257
def iter_next(self):
        """"""
        self.cursor += self.batch_size
        return self.cursor < self.num_data
942866
def cursor_for_object_in_connection(data, _object):
    '''
    
    '''
    if _object not in data:
        return None

    offset = data.index(_object)
    return offset_to_cursor(offset)
617510
def cursor(self):
        
        cursor = self.mdr.cursor()
        with self.transaction():
            try:
                yield cursor
                if cursor.rowcount != -1:
                    self.last_row_count = cursor.rowcount
                self.last_row_id = getattr(cursor, 'lastrowid', None)
            except:
                self.last_row_count = None
                self.last_row_id = None
                _safe_close(cursor)
                raise