Return the expected MAXIMUM number of rows for every table
961389
function(){
			var rows = this.model.get('options').rows*1 || null;
			if(rows) return Math.max(5, rows);

			var cellHeight = 30 || (this.$el.find('tr:first').height() || 30);
			var height = this.$el.parent().height() - this.$el.children(':first').height();
			rows = Math.round(height / cellHeight) - 2;
			return Math.max(8, rows);
		}
942348
def tcounts(self):
        
        df = pd.DataFrame([[t.name(), t.size()] for t in self.tables()], columns=["name", "size"])
        df.index = df.name
        return df
179984
function getMasterPillarRow( table )
	{
		var $rows = table.$.rows,
			maxCells = 0, cellsCount,
			$elected, $tr;

		for ( var i = 0, len = $rows.length ; i < len; i++ )
		{
			$tr = $rows[ i ];
			cellsCount = $tr.cells.length;

			if ( cellsCount > maxCells )
			{
				maxCells = cellsCount;
				$elected = $tr;
			}
		}

		return $elected;
	}
862262
def get_last_row(dbconn, tablename, n=1, uuid=None):
    
    return fetch(dbconn, tablename, n, uuid, end=True)
1119804
def table_print(classes, table):
    
    classes_len = len(classes)
    table_list = []
    for key in classes:
        table_list.extend(list(table[key].values()))
    table_list.extend(classes)
    table_max_length = max(map(len, map(str, table_list)))
    shift = "%-" + str(7 + table_max_length) + "s"
    result = shift % "Predict" + shift * \
        classes_len % tuple(map(str, classes)) + "\n"
    result = result + "Actual\n"
    classes.sort()
    for key in classes:
        row = [table[key][i] for i in classes]
        result += shift % str(key) + \
            shift * classes_len % tuple(map(str, row)) + "\n\n"
    if classes_len >= CLASS_NUMBER_THRESHOLD:
        result += "\n" + "Warning : " + CLASS_NUMBER_WARNING + "\n"
    return result
1018244
def _fetchall(self, query, vars, limit=None, offset=0):
        
        if limit is None:
            limit = current_app.config['DEFAULT_PAGE_SIZE']
        query += ' LIMIT %s OFFSET %s''' % (limit, offset)
        cursor = self.get_db().cursor()
        self._log(cursor, query, vars)
        cursor.execute(query, vars)
        return cursor.fetchall()
214013
def rowCount(self, index=None):
        """"""
        if self.axis == 0:
            return max(1, self._shape[0])
        else:
            if self.total_rows <= self.rows_loaded:
                return self.total_rows
            else:
                return self.rows_loaded
1371475
def dcounts(self):
        
        print("WARNING: Distinct value count for all tables can take a long time...", file=sys.stderr)
        sys.stderr.flush()

        data = []
        for t in self.tables():
            for c in t.columns():
                data.append([t.name(), c.name(), c.dcount(), t.size(), c.dcount() / float(t.size())])
        df = pd.DataFrame(data, columns=["table", "column", "distinct", "size", "fraction"])
        return df
365369
def get_last(self, n=1):
        
        rows = []
        # Get values from the partial db first
        if self.tracker.dbcon_part and check_table_exists(self.tracker.dbcon_part, self.name):
            rows.extend(get_last_row(self.tracker.dbcon_part, self.name, n))
        # Then add rows from the master if required
        if len(rows) < n and check_table_exists(self.tracker.dbcon_master, self.name):
            rows.extend(get_last_row(self.tracker.dbcon_master, self.name, n))
        return rows[-n:]
624512
def setupTable_maxp(self):
        """"""
        if "maxp" not in self.tables:
            return

        self.otf["maxp"] = maxp = newTable("maxp")
        maxp.tableVersion = 0x00005000
        maxp.numGlyphs = len(self.glyphOrder)
1327563
def enumerate_query_by_limit(q, limit=1000):
    
    for offset in count(0, limit):
        r = q.offset(offset).limit(limit).all()

        for row in r:
            yield row

        if len(r) < limit:
            break
708162
static final int tableSizeFor(int cap) {
        int n = cap - 1;
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
    }
736140
def GetNumberOfRows(self):
    
    if not self._database_object:
      raise IOError('Not opened.')

    if self._number_of_rows is None:
      self._number_of_rows = self._database_object.GetNumberOfRows(
          self._table_name)

    return self._number_of_rows
157093
private int getLargestContainerSize(Map<Integer, List<InstanceId>> allocation) {
    int max = 0;
    for (List<InstanceId> instances : allocation.values()) {
      if (instances.size() > max) {
        max = instances.size();
      }
    }
    return max;
  }
1215702
private boolean nextWithoutLimit() throws SQLException {
		if (maxRows > 0 && rowsFetched >= maxRows) {
			System.out.println("Reach max rows " + maxRows);
			return false;
		}

		if ((recordItr == null || !recordItr.hasNext()) && !emptyResultSet) {
			TSFetchResultsReq req = new TSFetchResultsReq(sql, fetchSize);

			try {
				TSFetchResultsResp resp = client.fetchResults(req);
				Utils.verifySuccess(resp.getStatus());
				if (!resp.hasResultSet) {
					emptyResultSet = true;
				} else {
					TSQueryDataSet tsQueryDataSet = resp.getQueryDataSet();
					List<RowRecord> records = Utils.convertRowRecords(tsQueryDataSet);
					recordItr = records.iterator();
				}
			} catch (TException e) {
				throw new SQLException("Cannot fetch result from server, because of network connection");
			}

		}
		if (emptyResultSet) {
			return false;
		}
		record = recordItr.next();
		// if(record.getDeltaObjectType() != null &&
		// record.getDeltaObjectType().equals(AGGREGATION_STR)){
		// if(columnInfo.containsKey(TIMESTAMP_STR)){
		// columnInfo.remove(TIMESTAMP_STR);
		// }
		// }

		rowsFetched++;
        // maxRows is a constraint that exists in parallel with the LIMIT&SLIMIT constraints,
        // so rowsFetched will increase whenever the row is fetched,
        // regardless of whether the row satisfies the LIMIT&SLIMIT constraints or not.

		return true;
	}
220784
def getMaxWidth(self, rows):
        ''
        w = 0
        if len(rows) > 0:
            w = max(max(len(self.getDisplayValue(r)) for r in rows), len(self.name))+2
        return max(w, len(self.name))
1355048
def max(cls):
        """"""
        max_recid = db.session.query(func.max(cls.recid)).scalar()
        return max_recid if max_recid else 0