Takes a list of rows and a column and returns the max of the values under that column in
        those rows.
975164
def max_number(self, rows: List[Row], column: NumberColumn) -> Number:
        
        cell_values = [row.values[column.name] for row in rows]
        if not cell_values:
            return 0.0  # type: ignore
        if not all([isinstance(value, Number) for value in cell_values]):
            raise ExecutionError(f"Invalid values for number selection function: {cell_values}")
        return max(cell_values)
29973
@Pure
	public static float max(float... values) {
		if (values == null || values.length == 0) {
			return Float.NaN;
		}
		float max = values[0];
		for (final float v : values) {
			if (v > max) {
				max = v;
			}
		}
		return max;
	}
396285
def mkcols(l, rows):
    '''
    
    '''
    cols = []
    base = 0
    while len(l) > rows and len(l) % rows != 0:
        l.append("")
    for i in range(rows, len(l) + rows, rows):
        cols.append(l[base:i])
        base = i
    return cols
298395
function(row, tmpRowDepth) {
                tmpRowDepth = tmpRowDepth || 1;

                for(var n=0; n<row.length; n++) {
                    var col = row[n];
                    // Column has children, so keep counting
                    if(YAHOO.lang.isArray(col.children)) {
                        tmpRowDepth++;
                        countMaxRowDepth(col.children, tmpRowDepth);
                        tmpRowDepth--;
                    }
                    // No children, is it the max depth?
                    else {
                        if(tmpRowDepth > maxRowDepth) {
                            maxRowDepth = tmpRowDepth;
                        }
                    }

                }
            }
1122218
def get_range_data(row_start, col_start, row_end, col_end) # :nodoc:
      # TODO. Check for worksheet limits.

      # Iterate through the table data.
      data = []
      (row_start .. row_end).each do |row_num|
        # Store nil if row doesn't exist.
        if !@cell_data_table[row_num]
          data << nil
          next
        end

        (col_start .. col_end).each do |col_num|
          if cell = @cell_data_table[row_num][col_num]
            data << cell.data
          else
            # Store nil if col doesn't exist.
            data << nil
          end
        end
      end

      return data
    end
517107
def iterrows(self, workbook=None):
        
        resolved_tables = []
        max_height = 0
        max_width = 0

        # while yielding rows __formula_values is updated with any formula values set on Expressions
        self.__formula_values = {}

        for name, (table, (row, col)) in list(self.__tables.items()):
            # get the resolved 2d data array from the table
            #
            # expressions with no explicit table will use None when calling
            # get_table/get_table_pos, which should return the current table.
            #
            self.__tables[None] = (table, (row, col))
            data = table.get_data(workbook, row, col, self.__formula_values)
            del self.__tables[None]

            height, width = data.shape
            upper_left = (row, col)
            lower_right = (row + height - 1, col + width - 1)

            max_height = max(max_height, lower_right[0] + 1)
            max_width = max(max_width, lower_right[1] + 1)
            
            resolved_tables.append((name, data, upper_left, lower_right))

        for row, col in self.__values.keys():
            max_width = max(max_width, row+1)
            max_height = max(max_height, col+1)

        # Build the whole table up-front. Doing it row by row is too slow.
        table = [[None] * max_width for i in range(max_height)]
        for name, data, upper_left, lower_right in resolved_tables:
            for i, r in enumerate(range(upper_left[0], lower_right[0]+1)):
                for j, c in enumerate(range(upper_left[1], lower_right[1]+1)):
                    table[r][c] = data[i][j]

        for (r, c), value in self.__values.items():
            if isinstance(value, Value):
                value = value.value
            if isinstance(value, Expression):
                if value.has_value:
                    self.__formula_values[(r, c)] = value.value
                value = value.get_formula(workbook, r, c)
            table[r][c] = value

        for row in table:
            yield row
552084
def same_as(self, rows: List[Row], column: Column) -> List[Row]:
        
        cell_value = rows[0].values[column.name]
        return_list = []
        for table_row in self.table_data:
            if table_row.values[column.name] == cell_value:
                return_list.append(table_row)
        return return_list
475175
function (start, end) {
      var r, rlen, c, clen, output = [], row;
      rlen = Math.max(start.row, end.row);
      clen = Math.max(start.col, end.col);
      for (r = Math.min(start.row, end.row); r <= rlen; r++) {
        row = [];
        for (c = Math.min(start.col, end.col); c <= clen; c++) {
          row.push(datamap.get(r, datamap.colToProp(c)));
        }
        output.push(row);
      }
      return output;
    }
613765
private static List<DTCellValue52> extractColumnData( List<List<DTCellValue52>> data,
                                                          int columnIndex ) {
        List<DTCellValue52> columnData = new ArrayList<DTCellValue52>();
        for ( List<DTCellValue52> row : data ) {
            columnData.add( row.get( columnIndex ) );
        }
        return columnData;
    }
940860
function arrayMax(data) {
	var i = data.length,
		max = data[0];

	while (i--) {
		if (data[i] > max) {
			max = data[i];
		}
	}
	return max;
}
234809
def getCell(self, row, column):
        
        row = int(row)
        column = int(column)
        if self._raster[0] == 0 or self._raster[1] == 0:
            return self
        rowHeight = self.h / self._raster[0]
        columnWidth = self.h / self._raster[1]
        if column < 0:
            # If column is negative, count backwards from the end
            column = self._raster[1] - column
            if column < 0:
                # Bad column index, return last column
                column = self._raster[1]
        elif column > self._raster[1]:
            # Bad column index, return first column
            column = 0
        if row < 0:
            # If row is negative, count backwards from the end
            row = self._raster[0] - row
            if row < 0:
                # Bad row index, return last row
                row = self._raster[0]
        elif row > self._raster[0]:
            # Bad row index, return first row
            row = 0
        return Region(self.x+(column*columnWidth), self.y+(row*rowHeight), columnWidth, rowHeight)
258446
public static int findMaxCol(Sheet sheet) {
        int maxCol = 0;
        for (int i = 0, ii = sheet.getLastRowNum(); i <= ii; ++i) {
            val row = sheet.getRow(i);
            if (row == null) continue;

            for (int j = row.getLastCellNum() - 1; j > maxCol; --j) {
                val cell = row.getCell(j);
                if (cell == null) continue;

                val value = getCellStringValue(cell);
                if (StringUtils.isNotEmpty(value)) {
                    maxCol = j;
                    break;
                }
            }
        }

        return maxCol;
    }
81907
def normalize_bbox(bbox, rows, cols):
    
    if rows == 0:
        raise ValueError('Argument rows cannot be zero')
    if cols == 0:
        raise ValueError('Argument cols cannot be zero')
    x_min, y_min, x_max, y_max = bbox[:4]
    normalized_bbox = [x_min / cols, y_min / rows, x_max / cols, y_max / rows]
    return normalized_bbox + list(bbox[4:])
696651
private static List<Integer> getMaxColumnSizes(List<String[]> resultSet) {
    List<Integer> maxColumnSizes = Lists.newArrayList();
    for (int i = 0; i < resultSet.get(0).length; i++) {
      int maxColumnSize = -1;
      for (int j = 0; j < resultSet.size(); j++) {
        if (resultSet.get(j)[i].length() > maxColumnSize) {
          maxColumnSize = resultSet.get(j)[i].length();
        }
      }
      maxColumnSizes.add(maxColumnSize);
    }
    return maxColumnSizes;
  }
735427
public static List<Row> minMaxColumns(DataRowsFacade data, List<String> columns) {
        String[] arr = new String[columns.size()];
        for (int i = 0; i < arr.length; i++)
            arr[i] = columns.get(i);
        return minMaxColumns(data, arr);
    }
319014
function createRows(items, columns, columnNames, paddingChr) {
  return items.map(item => {
    let row = []
    let numLines = 0
    columnNames.forEach(columnName => {
      numLines = Math.max(numLines, item[columnName].length)
    })
    // combine matching lines of each rows
    for (let i = 0; i < numLines; i++) {
      row[i] = row[i] || []
      columnNames.forEach(columnName => {
        let column = columns[columnName]
        let val = item[columnName][i] || '' // || '' ensures empty columns get padded
        if (column.align === 'right') row[i].push(padLeft(val, column.width, paddingChr))
        else if (column.align === 'center' || column.align === 'centre') row[i].push(padCenter(val, column.width, paddingChr))
        else row[i].push(padRight(val, column.width, paddingChr))
      })
    }
    return row
  })
}
1363428
def last(self, rows: List[Row]) -> List[Row]:
        
        if not rows:
            logger.warning("Trying to get last row from an empty list")
            return []
        return [rows[-1]]