/*
将当前行子项插入rows数组
195062
function pushChildRows(row, level) {
    var keyValue = row.keyValue;
    var oThis = this;
    var nowLevel = parseInt(level) + 1;
    var hasChild = false;
    var childRowArray = new Array();
    var childRowIndexArray = new Array();
    var spliceHasParentRows = new Array();
    $.each(this.hasParentRows, function (i) {
        if (this && this.parentKeyValue == keyValue) {
            hasChild = true;
            this.level = nowLevel;
            oThis.rows.push(this);
            childRowArray.push(this);
            var index = parseInt(oThis.rows.length - 1);
            childRowIndexArray.push(index);
            spliceHasParentRows.push(this);
            oThis.pushChildRows(this, nowLevel);
        }
    });
    $.each(spliceHasParentRows, function () {
        var index = oThis.hasParentRows.indexOf(this);
        oThis.hasParentRows.splice(index, 1);
    });
    row.hasChild = hasChild;
    row.childRow = childRowArray;
    row.childRowIndex = childRowIndexArray;
}
1365681
def iter_rows(self, start=None, end=None):
        """"""
        start = start or 0
        end = end or self.nrows
        for i in range(start, end):
            yield self.iloc[i, :]
460941
public void addRows(ArrayList<String> rows, String defaultValue) {
		CompactCharSequence dv = new CompactCharSequence(defaultValue);
		int oldlength = data.length;
		int numColumns = 0;
		if (data.length > 0 && data[0] != null) {
			numColumns = data[0].length;
		}
		data = (CompactCharSequence[][]) resizeArray(data, data.length + rows.size());
		for (int r = 0; r < rows.size(); r++) {
			data[oldlength + r] = new CompactCharSequence[numColumns];
			for (int c = 0; c < numColumns; c++) {
				data[oldlength + r][c] = dv;
			}
			data[oldlength + r][0] = new CompactCharSequence(rows.get(r));
			rowLookup.put(rows.get(r), new HeaderInfo(r + oldlength));
		}
	}
224584
function row (root, prefix, isTail, out, printNode) {
  if (root) {
    out(`${ prefix }${ isTail ? '└── ' : '├── ' }${ printNode(root) }\n`);
    const indent = prefix + (isTail ? '    ' : '│   ');
    if (root.left)  row(root.left,  indent, false, out, printNode);
    if (root.right) row(root.right, indent, true,  out, printNode);
  }
}
613173
protected void missingRow( Example row )
    {
        Example firstChild = row.firstChild();

        firstChild.annotate( Annotations.missing() );
        stats.wrong();

        if (firstChild.hasSibling())
        {
            for (Example cell : firstChild.nextSibling())
            {
                cell.annotate( Annotations.missing() );
            }
        }
    }
1111369
public function getCurrentRow()
    {
        if (isset($this->_currentRow) && $this->_currentRow->isFilled()) {
            $this->_currentRow = null;
        }
        if (is_null($this->_currentRow)) {
            $this->_currentRow = Yii::createObject(array_merge(['class' => $this->rowClass], $this->baseRow));
            $this->_rows[] = $this->_currentRow;
        }

        return $this->_currentRow;
    }
902451
private byte[] getNextRow(byte[] row, long writePointer, int count) {
    Bytes.putLong(row, queueRowPrefix.length, writePointer);
    Bytes.putInt(row, queueRowPrefix.length + Longs.BYTES, count + 1);
    return row;
  }
523846
def get_rows( self, key ):
        """"""
        if key not in self.roots:
            self.get_root( key )
        if key == 'location':
            return self.location_rows 
        else:
            return self.rows
433375
public TableLayoutBuilder row() {
        ++currentRow;
        lastCC = null;
        maxColumns = Math.max(maxColumns, currentCol);
        currentCol = 0;
        return this;
    }
150539
public function row($fields = null, $where = null, $orderBy = null)
    {
        // 按整个SELECT进行查询
        $table = self::selectArray($fields, $where, $orderBy, "1");

        // 如果有,返回第一行
        if ($table) {
            return $table[0];
        }

        return null;
    }
260386
function(rows, options) {
	
	this._options = _.clone(options || {});

	this._getRows( _.map(rows, function(row, key) {
		return new Row( row, this._options );
	}, this) );

	// .find expects an array
	this.filter(this._options.find);

	if (_.isObject(this._options.date_range)) {

		// does the same as select_for only using the dateRangeMatcher method;
		this.filter(this._options.date_range);
	}

	if (this._options.sortBy) {

		// does the same as select_for only using the dateRangeMatcher method;
		this.sortBy( this._options.sortBy, this._options.descending );
	}
	return this;
}
524199
private String[] getExpectedRow( TableIterator<String[]> tableRowIterator, DateTime expectedDT ) throws IOException {
        while( tableRowIterator.hasNext() ) {
            String[] row = tableRowIterator.next();
            DateTime currentTimestamp = formatter.parseDateTime(row[1]);
            if (currentTimestamp.equals(expectedDT)) {
                if (pNum == 1) {
                    return row;
                } else {
                    String[][] allRows = new String[pNum][];
                    allRows[0] = row;
                    int rowNum = 1;
                    for( int i = 1; i < pNum; i++ ) {
                        if (tableRowIterator.hasNext()) {
                            String[] nextRow = tableRowIterator.next();
                            allRows[i] = nextRow;
                            rowNum++;
                        }
                    }
                    // now aggregate
                    String[] aggregatedRow = new String[row.length];
                    // date is the one of the first instant
                    aggregatedRow[0] = allRows[0][0];
                    aggregatedRow[1] = allRows[0][1];
                    for( int col = 2; col < allRows[0].length; col++ ) {

                        boolean hasOne = false;
                        switch( pAggregation ) {
                        case 0:
                            double sum = 0;
                            for( int j = 0; j < rowNum; j++ ) {
                                String valueStr = allRows[j][col];
                                if (!valueStr.equals(fileNovalue)) {
                                    double value = Double.parseDouble(valueStr);
                                    sum = sum + value;
                                    hasOne = true;
                                }
                            }
                            if (!hasOne) {
                                sum = doubleNovalue;
                            }
                            aggregatedRow[col] = String.valueOf(sum);
                            break;
                        case 1:
                            double avg = 0;
                            for( int j = 0; j < rowNum; j++ ) {
                                String valueStr = allRows[j][col];
                                if (!valueStr.equals(fileNovalue)) {
                                    double value = Double.parseDouble(valueStr);
                                    avg = avg + value;
                                    hasOne = true;
                                }
                            }
                            if (!hasOne) {
                                avg = doubleNovalue;
                            } else {
                                avg = avg / pNum;
                            }
                            aggregatedRow[col] = String.valueOf(avg);
                            break;

                        default:
                            break;
                        }

                    }
                    return aggregatedRow;
                }
            } else if (currentTimestamp.isBefore(expectedDT)) {
                // browse until the instant is found
                continue;
            } else if (currentTimestamp.isAfter(expectedDT)) {
                /*
                 * lost the moment, for now throw exception.
                 * Could be enhanced in future.
                 */
                String message = "The data are not aligned with the simulation interval (" + currentTimestamp + "/" + expectedDT
                        + "). Check your data file: " + file;
                throw new IOException(message);
            }

        }
        return null;
    }
196140
function invShiftRows()
    {
        $temp = "";
        for ($i = 1; $i < 4; $i++) {
            for ($j = 0; $j < $this->Nb; $j++) $temp[($i + $j) % $this->Nb] = $this->s[$i][$j];
            for ($j = 0; $j < $this->Nb; $j++) $this->s[$i][$j] = $temp[$j];
        }
    }
1079346
@Override
    public Row lastRow(Session session, PersistentStore store) {

        readLock.lock();

        try {
            NodeAVL x = getAccessor(store);
            NodeAVL l = x;

            while (l != null) {
                x = l;
                l = x.getRight(store);
            }

            while (session != null && x != null) {
                Row row = x.getRow(store);

                if (session.database.txManager.canRead(session, row)) {
                    break;
                }

                x = last(store, x);
            }

            return x == null ? null
                             : x.getRow(store);
        } finally {
            readLock.unlock();
        }
    }
432830
def rows(self):
        """"""
        for t in self.terms:

            for row in t.rows:
                term, value = row  # Value can either be a string, or a dict

                if isinstance(value, dict):  # Dict is for properties, which might be arg-children
                    term, args, remain = self._args(term, value)
                    yield term, args

                    # 'remain' is all of the children that didn't have an arg-child column -- the
                    # section didn't have a column heder for that ther.
                    for k, v in remain.items():
                        yield term.split('.')[-1] + '.' + k, v
                else:
                    yield row
1262673
function getRowspanNum(data = [], child = []) {
  let childs = [];
  for (let i = 0; i < data.length; i += 1) {
    if (!data[i].children) {
      childs.push(data[i]);
    } else if (data[i].children && data[i].children.length > 0) {
      childs = childs.concat(getRowspanNum(data[i].children, child));
    }
  }
  return childs;
}
408016
public function getCurrentRow()
        {
            if (isset($this->rows[($this->int_ptr - 1)])) {
                return $this->rows[($this->int_ptr - 1)];
            }
            return null;
        }