Get a grid model of the table.
182817
function getTableGrid(tableDetails) {
        function key(rowIndex, colIndex) {
          return rowIndex + ',' + colIndex;
        }

        function getAt(rowIndex, colIndex) {
          return access[key(rowIndex, colIndex)];
        }

        function getAllCells() {
          var allCells = [];
          Tools.each(rows, function (row) {
            allCells = allCells.concat(row.cells);
          });
          return allCells;
        }

        function getAllRows() {
          return rows;
        }

        var access = {};
        var rows = [];

        var maxRows = 0;
        var maxCols = 0;

        Tools.each(tableDetails, function (row, rowIndex) {
          var currentRow = [];

          Tools.each(row.cells, function (cell) {

            var start = 0;

            while (access[key(rowIndex, start)] !== undefined) {
              start++;
            }

            var current = {
              element: cell.element,
              colspan: cell.colspan,
              rowspan: cell.rowspan,
              rowIndex: rowIndex,
              colIndex: start
            };

            for (var i = 0; i < cell.colspan; i++) {
              for (var j = 0; j < cell.rowspan; j++) {
                var cr = rowIndex + j;
                var cc = start + i;
                access[key(cr, cc)] = current;
                maxRows = Math.max(maxRows, cr + 1);
                maxCols = Math.max(maxCols, cc + 1);
              }
            }

            currentRow.push(current);
          });

          rows.push({
            element: row.element,
            cells: currentRow
          });
        });

        return {
          grid: {
            maxRows: maxRows,
            maxCols: maxCols
          },
          getAt: getAt,
          getAllCells: getAllCells,
          getAllRows: getAllRows
        };
      }
813405
def _get_rows(self, table):
        """"""

        childnodes = table.childNodes
        qname_childnodes = [(s.qname[1], s) for s in childnodes]
        return [node for name, node in qname_childnodes
                if name == u'table-row']
752142
def _create_grid(iterable, sizing_mode, layer=0):
    """"""
    return_list = []
    for item in iterable:
        if isinstance(item, list):
            return_list.append(_create_grid(item, sizing_mode, layer+1))
        elif isinstance(item, LayoutDOM):
            if sizing_mode is not None and _has_auto_sizing(item):
                item.sizing_mode = sizing_mode
            return_list.append(item)
        else:
            raise ValueError(
                """Only LayoutDOM items can be inserted into a layout.
                Tried to insert: %s of type %s""" % (item, type(item))
            )
    if layer % 2 == 0:
        return column(children=return_list, sizing_mode=sizing_mode)
    return row(children=return_list, sizing_mode=sizing_mode)
1250425
def getOverlayRenderModel(self, ulOverlayHandle, pchValue, unBufferSize):
        """"""

        fn = self.function_table.getOverlayRenderModel
        pColor = HmdColor_t()
        pError = EVROverlayError()
        result = fn(ulOverlayHandle, pchValue, unBufferSize, byref(pColor), byref(pError))
        return result, pColor, pError
1117145
def get(self):
        """"""
        options = {}
        for x in [self.axes, self.graphics, self.layout]:
            for k, v in list(x.get().items()):
                options[k] = v

        return options
508666
def page_models(self, constructor, paging, constraints=None, *, columns=None, order_by=None):
    """"""
    records, count = self.page(constructor.table_name, paging, constraints, columns=columns,
                               order_by=order_by)
    return ([constructor(r) for r in records], count)
784432
private static TableColumnModelListener createTableColumnModelListener(final JTable table) {
        return new TableColumnModelListener() {
            public void columnAdded(TableColumnModelEvent e) {
                if (table.getParent() instanceof JViewport && table.getParent().getParent() instanceof JScrollPane) {
                    table.getParent().repaint();
                }
            }

            public void columnMarginChanged(ChangeEvent e) {
                if (table.getParent() instanceof JViewport && table.getParent().getParent() instanceof JScrollPane) {
                    table.getParent().repaint();
                }
            }

            public void columnMoved(TableColumnModelEvent e) {
                if (table.getParent() instanceof JViewport && table.getParent().getParent() instanceof JScrollPane) {
                    table.getParent().repaint();
                }
            }

            public void columnRemoved(TableColumnModelEvent e) {
                if (table.getParent() instanceof JViewport && table.getParent().getParent() instanceof JScrollPane) {
                    table.getParent().repaint();
                }
            }

            public void columnSelectionChanged(ListSelectionEvent e) {
                if (table.getParent() instanceof JViewport && table.getParent().getParent() instanceof JScrollPane) {
                    table.getParent().repaint();
                }
            }
        };
    }
309979
def change_grid_shape(self, shape):
        """"""

        # Mark content as changed
        post_command_event(self.main_window, self.ContentChangedMsg)

        self.code_array.shape = shape

        # Update TableChoiceIntCtrl
        post_command_event(self.main_window, self.ResizeGridMsg, shape=shape)

        # Change grid table dimensions
        self.grid.GetTable().ResetView()

        # Clear caches
        self.code_array.result_cache.clear()
885049
function (start, end) {
      var corners = grid.getCornerCoords([start, end]);
      var r, c, output = [];
      for (r = corners.TL.row; r <= corners.BR.row; r++) {
        for (c = corners.TL.col; c <= corners.BR.col; c++) {
          output.push(self.view.getCellAtCoords({
            row: r,
            col: c
          }));
        }
      }
      return output;
    }
546053
def row(self):
        """"""
        ret = None
        i = self.tableWidget.currentRow()
        if i >= 0:
            ret = self._data[i]
        return ret
472766
public function grid(): array
    {
        return [
            TD::set('id', 'ID')
                ->align(TD::ALIGN_CENTER)
                ->width('100px')
                ->filter('numeric')
                ->sort()
                ->linkPost(),

            TD::set('name', 'Name')
                ->width('250px')
                ->locale()
                ->column('content.name')
                ->filter('text')
                ->sort()
                ->linkPost('name'),

            TD::set('status')
                ->sort(),

            TD::set('phone', 'Phone')
                ->locale()
                ->column('content.phone')
                ->filter('text')
                ->linkPost('phone'),

            TD::set('publish_at', 'Date of publication')
                ->filter('date')
                ->sort()
                ->align(TD::ALIGN_RIGHT)
                ->render(function ($item) {
                    return optional($item->publish_at)->toDateString();
                }),

            TD::set('created_at', 'Date of creation')
                ->filter('date')
                ->align(TD::ALIGN_RIGHT)
                ->sort()
                ->render(function ($item) {
                    return $item->created_at->toDateString();
                }),
        ];
    }
545784
def grid_items(self):
        
        if list(self.keys()) == []:  return {}
        cols = self._max_cols
        return {(idx // cols, idx % cols): (key, item)
                for idx, (key, item) in enumerate(self.data.items())}
59982
def model_vis(self, context):
        
        column = self._vis_column
        msshape = None

        # Do we have a column descriptor for the supplied column?
        try:
            coldesc = self._manager.column_descriptors[column]
        except KeyError as e:
            coldesc = None

        # Try to get the shape from the descriptor
        if coldesc is not None:
            try:
                msshape = [-1] + coldesc['shape'].tolist()
            except KeyError as e:
                msshape = None

        # Otherwise guess it and warn
        if msshape is None:
            guessed_shape = [self._manager._nchan, 4]

            montblanc.log.warn("Could not obtain 'shape' from the '{c}' "
                "column descriptor. Guessing it is '{gs}'.".format(
                    c=column, gs=guessed_shape))

            msshape = [-1] + guessed_shape

        lrow, urow = MS.row_extents(context)

        self._manager.ordered_main_table.putcol(column,
            context.data.reshape(msshape),
            startrow=lrow, nrow=urow-lrow)
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);
        });
      }
185039
def _get_column_widths(self):
        """"""
        col_widths = {}
        for table, (row, col) in self.__tables.values():
            for colname, width in table.column_widths.items():
                ic = col + table.get_column_offset(colname)
                current_width = col_widths.setdefault(ic, width)
                col_widths[ic] = max(width, current_width)
        return col_widths
305942
function getGrid(step, source, target) {

        return {
            source: source.clone(),
            x: getGridDimension(target.x - source.x, step),
            y: getGridDimension(target.y - source.y, step)
        };
    }
815641
private Grid getGridLayout(int count) {

        Grid grid = new Grid();
        int x, y, z, modolo = 0;
        x = count % 3;
        y = count % 5;
        z = count % 7;
        if ((z <= y) && (z <= x)) {
            modolo = 7;
        } else if ((y <= z) && (y <= x)) {
            modolo = 5;
        } else if ((x <= z) && (x <= y)) {
            modolo = 3;
        }

        if (count < modolo) {
            grid = new Grid(count, 1);
        } else if ((count % modolo) == 0) {
            grid = new Grid(count / modolo, modolo);
        } else {
            grid = new Grid((count / modolo) + 1, modolo);
        }
        return grid;
    }