Create a segment on each of the specified cells.

    @param cells (numpy array)
488739
def createSegments(self, cells):
    
    segments = None

    for connections in self.connectionsBySource.itervalues():
      created = connections.createSegments(cells)

      if segments is None:
        segments = created
      else:
        # Sanity-check that the segment numbers are the same.
        np.testing.assert_equal(segments, created)

    return segments
290346
public static int mergingCells(Sheet sheet, int firstRow, int lastRow, int firstColumn, int lastColumn, CellStyle cellStyle) {
		final CellRangeAddress cellRangeAddress = new CellRangeAddress(//
				firstRow, // first row (0-based)
				lastRow, // last row (0-based)
				firstColumn, // first column (0-based)
				lastColumn // last column (0-based)
		);

		if (null != cellStyle) {
			RegionUtil.setBorderTop(cellStyle.getBorderTopEnum(), cellRangeAddress, sheet);
			RegionUtil.setBorderRight(cellStyle.getBorderRightEnum(), cellRangeAddress, sheet);
			RegionUtil.setBorderBottom(cellStyle.getBorderBottomEnum(), cellRangeAddress, sheet);
			RegionUtil.setBorderLeft(cellStyle.getBorderLeftEnum(), cellRangeAddress, sheet);
		}
		return sheet.addMergedRegion(cellRangeAddress);
	}
808427
void growCellArray(int imageWidth, int imageHeight) {
		cellCols = imageWidth/ pixelsPerCell;
		cellRows = imageHeight/ pixelsPerCell;

		if( cellRows*cellCols > cells.length ) {
			Cell[] a = new Cell[cellCols*cellRows];

			System.arraycopy(cells,0,a,0,cells.length);
			for (int i = cells.length; i < a.length; i++) {
				a[i] = new Cell();
				a[i].histogram = new float[ orientationBins ];
			}
			cells = a;
		}
	}
204129
function (range) {
            var cells = this.getCells(range);
            UETable.addSelectedClass(cells);
            this.selectedTds = cells;
            this.cellsRange = range;
        }
277217
def sampleCellsWithinColumns(numCellPairs, cellsPerColumn, numColumns, seed=42):
  
  np.random.seed(seed)
  cellPairs = []
  for i in range(numCellPairs):
    randCol = np.random.randint(numColumns)
    randCells = np.random.choice(np.arange(cellsPerColumn), (2, ), replace=False)

    cellsPair = randCol * cellsPerColumn + randCells
    cellPairs.append(cellsPair)
  return cellPairs
110339
function(cells, opt) {

        var preparedCells = joint.util.toArray(cells).map(function(cell) {
            return this._prepareCell(cell, opt);
        }, this);
        this.get('cells').reset(preparedCells, opt);

        return this;
    }
72838
def cells(*args)
      cells = TableCellCollection.new(self, extract_selector(args).merge(:tag_name => /^(th|td)$/))
      cells.locator_class = ChildCellLocator

      cells
    end
1205115
private Cell newCell(Row tmplRow, int cellCol, int rowOffset, Row row, Object cellValue, int maxLen) {
        val cell = getOrCreateCell(tmplRow, cellCol, rowOffset, row);

        val value = PoiUtil.writeCellValue(cell, cellValue);

        fixMaxRowHeightRatio(row, maxLen, value);
        return cell;
    }
351610
function(array){
		var cell = this.getcell();
		if(cell.isnull){ return;}

		if(cell!==this.cursor.getc() && this.inputMode==='auto'){
			this.setcursor(cell);
		}
		else{
			this.inputQues_main(array,cell);
		}
	}
933130
public static List<String> contentAsList( Iterable<Example> cells )
    {
        return new ArrayList<String>( Arrays.asList( content( cells ) ) );
    }
1288696
public Cell createCell(SimpleCell rowAttributes) throws BadElementException {
		Cell cell = new Cell();
		cell.cloneNonPositionParameters(rowAttributes);
		cell.softCloneNonPositionParameters(this);
		cell.setColspan(colspan);
		cell.setHorizontalAlignment(horizontalAlignment);
		cell.setVerticalAlignment(verticalAlignment);
		cell.setUseAscender(useAscender);
		cell.setUseBorderPadding(useBorderPadding);
		cell.setUseDescender(useDescender);
		Element element;
		for (Iterator i = content.iterator(); i.hasNext(); ) {
			element = (Element)i.next();
			cell.addElement(element);
		}
		return cell;
	}
1330786
def create_edges(cells_nodes):
    
    # Create the idx_hierarchy (nodes->edges->cells), i.e., the value of
    # `self.idx_hierarchy[0, 2, 27]` is the index of the node of cell 27, edge
    # 2, node 0. The shape of `self.idx_hierarchy` is `(2, 3, n)`, where `n` is
    # the number of cells. Make sure that the k-th edge is opposite of the k-th
    # point in the triangle.
    local_idx = numpy.array([[1, 2], [2, 0], [0, 1]]).T
    # Map idx back to the nodes. This is useful if quantities which are in
    # idx shape need to be added up into nodes (e.g., equation system rhs).
    nds = cells_nodes.T
    idx_hierarchy = nds[local_idx]

    s = idx_hierarchy.shape
    a = numpy.sort(idx_hierarchy.reshape(s[0], s[1] * s[2]).T)

    b = numpy.ascontiguousarray(a).view(
        numpy.dtype((numpy.void, a.dtype.itemsize * a.shape[1]))
    )
    _, idx, inv, cts = numpy.unique(
        b, return_index=True, return_inverse=True, return_counts=True
    )

    # No edge has more than 2 cells. This assertion fails, for example, if
    # cells are listed twice.
    assert all(cts < 3)

    edge_nodes = a[idx]
    cells_edges = inv.reshape(3, -1).T

    return edge_nodes, cells_edges
886349
public void setColumns(List<Cell> columns)
    {
        for (Cell column : columns)
        {
            putColumn(CellUtil.cloneFamily(column), CellUtil.cloneQualifier(column), CellUtil.cloneValue(column));
        }
    }
974908
private void newBlock(String m)
    {
        if (row==null)
            newRow();
        else
            row.unnest();
        row.nest(cell=new Block(m));

        if (cellNestFactory!=null)
            cell.nest(cellNestFactory.newComposite());  
    }
639951
function TicTacToeBoard(cells){
    this.board = [];
		for(var i=0; i<NUM_CELLS; i++) {
      if(cells){
        this.board[i] = cells[i];
      } else {
        this.board[i] = Cell.EMPTY;
      }
		}
  }
708221
public void createValueCells(Object... values) {
        for (Object value : values) {
            if (value == null) {
                this.createCell("");
                continue;
            }

            if (value instanceof String) {
                this.createCell((String) value);
            } else if (value instanceof Date) {
                this.createCell((Date) value);
            } else if (ValidationObjUtil.isIntType(value.getClass())) {
                long longValue = Long.valueOf(value + "");
                this.createCell(longValue);
            } else if (ValidationObjUtil.isDoubleType(value.getClass())) {
                double doubleValue = Double.valueOf(value + "");
                this.createCell(doubleValue);
            } else {
                this.createCell(value);
            }
        }
    }
695049
public static void appendTable(ParagraphAlignment[] alignment, int rows, int cols, String[][] values, int[]
            rowHeight, int[] colWidth, Map<String, Integer> cellMargins, Map<String, Object> styles) {
        createXwpfDocumentIfNull();
        xwpfDocument.createParagraph();
        XWPFTable table = xwpfDocument.createTable(rows, cols);
        XWPFParagraph paragraph;
        XWPFTableRow row;
        XWPFTableCell cell;
        CTTcPr cellPr;
        XWPFRun run;
        if (Checker.isNotEmpty(cellMargins)) {
            int top = MsUtils.checkInteger(cellMargins.get("top"));
            int left = MsUtils.checkInteger(cellMargins.get("left"));
            int bottom = MsUtils.checkInteger(cellMargins.get("bottom"));
            int right = MsUtils.checkInteger(cellMargins.get("right"));
            table.setCellMargins(top, left, bottom, right);
        }
        int minRow = Math.min(rows, values.length);
        for (int i = 0; i < minRow; i++) {
            row = table.getRow(i);
            int height = i < rowHeight.length ? rowHeight[i] : rowHeight[rowHeight.length - 1];
            row.setHeight(height);
            String[] value = values[i];
            int minCol = Math.min(cols, value.length);
            for (int j = 0; j < minCol; j++) {
                cell = row.getCell(j);
                cellPr = cell.getCTTc().addNewTcPr();
                int width = j < colWidth.length ? colWidth[j] : colWidth[colWidth.length - 1];
                cellPr.addNewTcW().setW(BigInteger.valueOf(width));
                paragraph = cell.getParagraphs().get(0);
                int idx = i * cols + j;
                ParagraphAlignment align = idx < alignment.length ? alignment[idx] : alignment[alignment.length - 1];
                paragraph.setAlignment(align);
                run = paragraph.createRun();
                run.setText(value[j]);
                setStyle(run, styles);
            }
        }
    }