code: def get_minimum_size(self, data):
          
  
          # Gat a list of elements with their sizes, so we don't have to
          # recalculate that each time.
          sized_elements = [
              (col, row, cols, rows, element, element.get_minimum_size(data))
              for col, row, cols, rows, element in self.elements
              ]
  
          # Create the heights and widths for each cell.
          self.col_widths = [0] * self.cols
          self.row_heights = [0] * self.rows
          self._compile_dimension_size(0, self.col_widths, 'x', sized_elements)
          self._compile_dimension_size(1, self.row_heights, 'y', sized_elements)
  
          # The final size is the total width and height
          om = 2*self.outside_margin
          return datatypes.Point(
              sum(self.col_widths) + (self.cols-1)*self.margin + om,
              sum(self.row_heights) + (self.rows-1)*self.margin + om
              )
docs: Finds the minimum size of the grid.