Attempt to get representative blocks for the height of each row.
330378
function getRowBlocks(tableGrid) {
        var cols = range(0, tableGrid.grid.maxCols);
        var rows = range(0, tableGrid.grid.maxRows);

        return Tools.map(rows, function (row) {
          function getBlock() {
            var details = [];
            for (var i = 0; i < cols.length; i++) {
              var detail = tableGrid.getAt(row, i);
              if (detail && detail.rowIndex === row) {
                details.push(detail);
              }
            }
            return details;
          }

          function isSingle(detail) {
            return detail.rowspan === 1;
          }

          function getFallback() {
            return tableGrid.getAt(row, 0);
          }

          return decide(getBlock, isSingle, getFallback);
        });
      }
150133
protected void computeWeightBlockPixels() {

		int rows = cellsPerBlockY*pixelsPerCell;
		int cols = cellsPerBlockX*pixelsPerCell;

		weights = new double[ rows*cols ];

		double offsetRow=0,offsetCol=0;
		int radiusRow=rows/2,radiusCol=cols/2;
		if( rows%2 == 0 ) {
			offsetRow = 0.5;
		}
		if( cols%2 == 0 ) {
			offsetCol = 0.5;
		}

		// use linear seperability of a Gaussian to make computation easier
		// sigma is 1/2 the width along each axis
		int index = 0;
		for (int row = 0; row < rows; row++) {
			double drow = row-radiusRow+offsetRow;
			double pdfRow = UtilGaussian.computePDF(0, radiusRow, drow);

			for (int col = 0; col < cols; col++) {
				double dcol = col-radiusCol+offsetCol;
				double pdfCol = UtilGaussian.computePDF(0, radiusCol, dcol);

				weights[index++] = pdfCol*pdfRow;
			}
		}
		// normalize so that the largest value is 1.0
		double max = 0;
		for (int i = 0; i < weights.length; i++) {
			if( weights[i] > max ) {
				max = weights[i];
			}
		}
		for (int i = 0; i < weights.length; i++) {
			weights[i] /= max;
		}
	}
1333147
def _row_heights2pys(self):
        

        for row, tab in self.code_array.dict_grid.row_heights:
            if row < self.code_array.shape[0] and \
               tab < self.code_array.shape[2]:
                height = self.code_array.dict_grid.row_heights[(row, tab)]
                height_strings = map(repr, [row, tab, height])
                self.pys_file.write(u"\t".join(height_strings) + u"\n")
894943
def blockshapes(self):
        """"""
        if self._blockshapes is None:
            if self._filename:
                self._populate_from_rasterio_object(read_image=False)
            else:
                # if no file is attached to the raster set the shape of each band to be the data array size
                self._blockshapes = [(self.height, self.width) for z in range(self.num_bands)]
        return self._blockshapes
1279853
function(items) {
            for(var i = 0; i < items.length; i++) {
                var height = items[i].element[0].getBoundingClientRect().height;
                var relPosDiff = items[i].diffWithNextRelativePos;
                var ratio = 0;
                if(!isNaN(height) && !isNaN(relPosDiff))
                    ratio = height / relPosDiff;

                items[i].relativePosRatio = ratio;
            }
        }
439096
public static boolean bidiagOuterBlocks( final int blockLength ,
                                             final DSubmatrixD1 A ,
                                             final double gammasU[],
                                             final double gammasV[])
    {
//        System.out.println("---------- Orig");
//        A.original.print();

        int width = Math.min(blockLength,A.col1-A.col0);
        int height = Math.min(blockLength,A.row1-A.row0);

        int min = Math.min(width,height);

        for( int i = 0; i < min; i++ ) {
            //--- Apply reflector to the column

            // compute the householder vector
            if (!computeHouseHolderCol(blockLength, A, gammasU, i))
                return false;

            // apply to rest of the columns in the column block
            rank1UpdateMultR_Col(blockLength,A,i,gammasU[A.col0+i]);

            // apply to the top row block
            rank1UpdateMultR_TopRow(blockLength,A,i,gammasU[A.col0+i]);

            System.out.println("After column stuff");
            A.original.print();

            //-- Apply reflector to the row
            if(!computeHouseHolderRow(blockLength,A,gammasV,i))
                return false;
            
            // apply to rest of the rows in the row block
            rank1UpdateMultL_Row(blockLength,A,i,i+1,gammasV[A.row0+i]);

            System.out.println("After update row");
            A.original.print();

            // apply to the left column block
            // TODO THIS WON'T WORK!!!!!!!!!!!!!
            // Needs the whole matrix to have been updated by the left reflector to compute the correct solution
//            rank1UpdateMultL_LeftCol(blockLength,A,i,i+1,gammasV[A.row0+i]);

            System.out.println("After row stuff");
            A.original.print();
        }

        return true;
    }
703105
def get_block_hash_by_height(self, height: int, is_full: bool = False) -> str:
        
        payload = self.generate_json_rpc_payload(RpcMethod.GET_BLOCK_HASH, [height, 1])
        response = self.__post(self.__url, payload)
        if is_full:
            return response
        return response['result']
678119
def split_block_by_row_length(block, split_row_length):
    '''
    
    '''
    split_blocks = []
    current_block = []
    for row in block:
        if row_content_length(row) <= split_row_length:
            if current_block:
                split_blocks.append(current_block)
            split_blocks.append([row])
            current_block = []
        else:
            current_block.append(row)
    if current_block:
        split_blocks.append(current_block)

    return split_blocks
254475
def get_block(self, x,y,z, coord=False):
        """
        Laid out like:
        (0,0,0), (0,1,0), (0,2,0) ... (0,127,0), (0,0,1), (0,1,1), (0,2,1) ... (0,127,1), (0,0,2) ... (0,127,15), (1,0,0), (1,1,0) ... (15,127,15)
        
        ::
        
          blocks = []
          for x in range(15):
            for z in range(15):
              for y in range(127):
                blocks.append(Block(x,y,z))
        """

        offset = y + z*128 + x*128*16 if (coord == False) else coord[1] + coord[2]*128 + coord[0]*128*16
        return self.blocksList[offset]
130685
def get_rowspanned_columns(self):
        """"""
        spanned_columns = {}
        current_row_index = self._index
        current_row_cols = sum(cell.colspan for cell in self)
        prev_rows = iter(reversed(self.section[:current_row_index]))
        while current_row_cols < self.section.num_columns:
            row = next(prev_rows)
            min_rowspan = current_row_index - int(row._index)
            if row.maximum_rowspan > min_rowspan:
                for cell in (c for c in row if c.rowspan > min_rowspan):
                    col_index = int(cell.column_index)
                    spanned_columns[col_index] = cell.colspan
                    current_row_cols += cell.colspan
        return spanned_columns
411051
function(items, setting) {
            var runtime = setting.runtime,
                row = runtime.limitRow,
                col = runtime.limitCol,
                x = 0,
                y = 0,
                maxX = runtime.totalCol,
                maxY = runtime.totalRow,
                wall = {},
                holes = runtime.holes,
                block = null,
                matrix = runtime.matrix,
                bigLoop = Math.max(col, row),
                freeArea = null,
                misBlock = null,
                fitWidth = col < row ? 1 : 0,
                lastBlock = null,
                smallLoop = Math.min(col, row);
    
            // fill area with top, left, width, height;
            function fillMatrix(id, t, l, w, h) {
                for (var y = t; y < t + h;) {
                    for (var x = l; x < l + w;) {
                        matrix[y + '-' + x] = id;
                        ++x > maxX && (maxX = x);
                    }
                    ++y > maxY && (maxY = y);
                }
            }
            
            // set a hole on the wall;
            for (var i in holes) {
                if (holes.hasOwnProperty(i)) {
                    fillMatrix(holes[i]["id"] || true, holes[i]['top'], holes[i]['left'], holes[i]['width'], holes[i]['height']);
                }
            }
            
    
            for (var b = 0; b < bigLoop; ++b) {
                if (!items.length) break;
                fitWidth ? (y = b) : (x = b);
                lastBlock = null;
    
                for (var s = 0; s < smallLoop; ++s) {
                    if (!items.length) break;
                    fitWidth ? (x = s) : (y = s);
                    if (runtime.matrix[y + '-' + x]) continue;
                    freeArea = layoutManager.getFreeArea(y, x, runtime);
                    block = null;
                    for (var i = 0; i < items.length; ++i) {
                        if (items[i].height > freeArea.height) continue;
                        if (items[i].width > freeArea.width) continue;
                        block = items.splice(i, 1)[0];
                        break;
                    }
    
                    // trying resize the other block to fit gap;
                    if (block == null && setting.fixSize == null) {
                        // resize near block to fill gap;
                        if (lastBlock && !fitWidth && runtime.minHoB > freeArea.height) {
                            lastBlock.height += freeArea.height;
                            fillMatrix(lastBlock.id, lastBlock.y, lastBlock.x, lastBlock.width, lastBlock.height);
                            layoutManager.setBlock(lastBlock, setting);
                            continue;
                        } else if (lastBlock && fitWidth && runtime.minWoB > freeArea.width) {
                            lastBlock.width += freeArea.width;
                            fillMatrix(lastBlock.id, lastBlock.y, lastBlock.x, lastBlock.width, lastBlock.height);
                            layoutManager.setBlock(lastBlock, setting);
                            continue;
                        } else {
                            // get other block fill to gap;
                            for (var i = 0; i < items.length; ++i) {
                                if (items[i]['fixSize'] != null) continue;
                                block = items.splice(i, 1)[0];
                                if (fitWidth) {
                                    block.width = freeArea.width;
                                    if (setting.cellH == 'auto') {
                                        layoutManager.adjustBlock(block, setting);
                                    }
                                    // for fitZone;
                                    block.height = Math.min(block.height, freeArea.height);
                                } else {
                                    block.height = freeArea.height;
                                    // for fitZone;
                                    block.width = Math.min(block.width, freeArea.width);
                                }
                                break;
                            }
                        }
                    }
                    
                    if (block != null) {
                        wall[block.id] = {
                            id: block.id,
                            x: x,
                            y: y,
                            width: block.width,
                            height: block.height,
                            fixSize: block.fixSize
                        };
                        
                        // keep success block for next round;
                        lastBlock = wall[block.id];
    
                        fillMatrix(lastBlock.id, lastBlock.y, lastBlock.x, lastBlock.width, lastBlock.height);
                        layoutManager.setBlock(lastBlock, setting);
                    } else {
                        // get expect area;
                        var misBlock = {
                            x: x,
                            y: y,
                            fixSize: 0
                        };
                        if (fitWidth) {
                            misBlock.width = freeArea.width;
                            misBlock.height = 0;
                            var lastX = x - 1;
                            var lastY = y;
                            
                            while (matrix[lastY + '-' + lastX]) {
                                matrix[lastY + '-' + x] = true;
                                misBlock.height += 1;
                                lastY += 1;
                            }
                        } else {
                            misBlock.height = freeArea.height;
                            misBlock.width = 0;
                            var lastY = y - 1;
                            var lastX = x;
                            
                            while (matrix[lastY + '-' + lastX]) {
                                matrix[y + '-' + lastX] = true;
                                misBlock.width += 1;
                                lastX += 1;
                            }
                        }
                        setting.onGapFound(layoutManager.setBlock(misBlock, setting), setting);
                    }
                }
    
            }
    
            runtime.matrix = matrix;
            runtime.totalRow = maxY;
            runtime.totalCol = maxX;
        }
1187376
function (rows) {
		var row,
			rowsLength,
			col,
			colsLength,
			columns;

		if (rows) {
			columns = [];
			rowsLength = rows.length;
			for (row = 0; row < rowsLength; row++) {
				colsLength = rows[row].length;
				for (col = 0; col < colsLength; col++) {
					if (!columns[col]) {
						columns[col] = [];
					}
					columns[col][row] = rows[row][col];
				}
			}
		}
		return columns;
	}
1075202
public static double findMaxCol(final int blockLength , final DSubmatrixD1 Y , final int col )
    {
        final int width = Math.min(blockLength,Y.col1-Y.col0);

        final double dataY[] = Y.original.data;

        double max = 0;

        for( int i = Y.row0; i < Y.row1; i += blockLength ) {
            int height = Math.min( blockLength , Y.row1 - i );

            int index = i*Y.original.numCols + height*Y.col0 + col;

            if( i == Y.row0 ) {
                index += width*col;
                for( int k = col; k < height; k++ , index += width ) {
                    double v = Math.abs(dataY[index]);
                    if( v > max ) {
                        max = v;
                    }
                }
            } else {
                for( int k = 0; k < height; k++ , index += width ) {
                    double v = Math.abs(dataY[index]);
                    if( v > max ) {
                        max = v;
                    }
                }
            }
        }

        return max;
    }
610460
def get_block_height(self, is_full: bool = False) -> int or dict:
        
        response = self.get_block_count(is_full=True)
        response['result'] -= 1
        if is_full:
            return response
        return response['result']
1149222
double[] getBlockData(int row, int column) {
		int blockNumber = layout.getBlockNumber(row, column);
		double[] block = data[blockNumber];

		if (null == block) {
			block = new double[layout.getBlockSize(row, column)];
			data[blockNumber] = block;
		}
		return data[blockNumber];
	}
295057
def each_pixel
      get_pixels(0, 0, columns, rows).each_with_index do |p, n|
        yield(p, n % columns, n / columns)
      end
      self
    end
387654
function getClearedHeight(e) {
                    var height = e.height();

                    e.children().each(function () {
                        height = Math.max(height, $(this).height());
                    });

                    return height;
                }