class_docstr: Widget for proportionally dividing its internal area into a grid.
  
  This widget will automatically set the position and size of child widgets
  according to provided constraints.
  
  Parameters
  ----------
  spacing : int
      Spacing between widgets.
  **kwargs : dict
      Keyword arguments to pass to `Widget`.
code: def _add_widget_dim_constraints(
      solver,
      width_grid,
      height_grid,
      total_var_w,
      total_var_h,
      grid_widgets,
  ):
      assert total_var_w is not None
      assert total_var_h is not None
  
      for ws in width_grid:
          for w in ws:
              solver.addConstraint(
                  w >= 0,
              )
  
      for hs in height_grid:
          for h in hs:
              solver.addConstraint(h >= 0)
  
      for _, val in grid_widgets.items():
          (y, x, ys, xs, widget) = val
  
          for ws in width_grid[y : y + ys]:
              total_w = np.sum(ws[x : x + xs])
              # assert(total_w is not None)
              solver.addConstraint(total_w >= widget.width_min)
  
              if widget.width_max is not None:
                  solver.addConstraint(total_w <= widget.width_max)
              else:
                  solver.addConstraint(total_w <= total_var_w)
  
          for hs in height_grid[x : x + xs]:
              total_h = np.sum(hs[y : y + ys])
              solver.addConstraint(total_h >= widget.height_min)
  
              if widget.height_max is not None:
                  solver.addConstraint(total_h <= widget.height_max)
              else:
                  solver.addConstraint(total_h <= total_var_h)
  
imports: from __future__ import division
  import numpy
  from vispy.geometry import Rect
  from .widget import Widget
  from .viewbox import ViewBox
  from kiwisolver import Solver, Variable, UnsatisfiableConstraint
label_desc: Use image node_id 18 for calling the Grid obj's underlying member method code with example usage: obj._add_widget_dim_constraints(solver, width_grid, height_grid, total_var_w, total_var_h, grid_widgets) without return types