nodes: 0, module; 1, function_definition; 2, function_name:getAllCellsInColumns; 3, parameters; 4, block; 5, identifier:columns; 6, identifier:cellsPerColumn; 7, expression_statement; 8, comment:# Add; 9, comment:#   [[beginningOfColumn0],; 10, comment:#    [beginningOfColumn1],; 11, comment:#     ...]; 12, comment:# to; 13, comment:#   [0, 1, 2, ..., cellsPerColumn - 1]; 14, comment:# to get; 15, comment:#   [beginningOfColumn0 + 0, beginningOfColumn0 + 1, ...; 16, comment:#    beginningOfColumn1 + 0, ...; 17, comment:#    ...]; 18, comment:# then flatten it.; 19, return_statement; 20, comment:"""
    Calculate all cell indices in the specified columns.
  
    @param columns (numpy array)
    @param cellsPerColumn (int)
  
    @return (numpy array)
    All cells within the specified columns. The cells are in the same order as the
    provided columns, so they're sorted if the columns are sorted.
    """; 21, call; 22, attribute; 23, argument_list; 24, parenthesized_expression; 25, identifier:flatten; 26, binary_operator:(columns * cellsPerColumn).reshape((-1, 1)) +
            np.arange(cellsPerColumn, dtype="uint32"); 27, call; 28, call; 29, attribute; 30, argument_list; 31, attribute; 32, argument_list; 33, parenthesized_expression; 34, identifier:reshape; 35, tuple; 36, identifier:np; 37, identifier:arange; 38, identifier:cellsPerColumn; 39, keyword_argument; 40, binary_operator:columns * cellsPerColumn; 41, unary_operator; 42, integer:1; 43, identifier:dtype; 44, string:"uint32"; 45, identifier:columns; 46, identifier:cellsPerColumn; 47, integer:1
code: def getAllCellsInColumns(columns, cellsPerColumn):
    """
    Calculate all cell indices in the specified columns.
  
    @param columns (numpy array)
    @param cellsPerColumn (int)
  
    @return (numpy array)
    All cells within the specified columns. The cells are in the same order as the
    provided columns, so they're sorted if the columns are sorted.
    """
  
    # Add
    #   [[beginningOfColumn0],
    #    [beginningOfColumn1],
    #     ...]
    # to
    #   [0, 1, 2, ..., cellsPerColumn - 1]
    # to get
    #   [beginningOfColumn0 + 0, beginningOfColumn0 + 1, ...
    #    beginningOfColumn1 + 0, ...
    #    ...]
    # then flatten it.
    return ((columns * cellsPerColumn).reshape((-1, 1)) +
            np.arange(cellsPerColumn, dtype="uint32")).flatten()