class_docstr: Implements the ``constrained_layout`` geometry management.  See
  :ref:`constrainedlayout_guide` for details.
class_docstr_tok: ["Implements","the","``","constrained_layout","``","geometry","management",".","See",":","ref",":","`","constrainedlayout_guide","`","for","details","."]
docstr: Perform constrained_layout and move and resize Axes accordingly.
  
  Parameters
  ----------
  fig : `.Figure` to perform layout on.
docstr_tok: ["Perform","constrained_layout","and","move","and","resize","Axes","accordingly",".","Parameters","--","--","--","--","--","fig",":","`",".Figure","`","to","perform","layout","on","."]
code: def execute(self, fig):
      """
      Perform constrained_layout and move and resize Axes accordingly.
  
      Parameters
      ----------
      fig : `.Figure` to perform layout on.
      """
      width, height = fig.get_size_inches()
      # pads are relative to the current state of the figure...
      w_pad = self._params["w_pad"] / width
      h_pad = self._params["h_pad"] / height
  
      return do_constrained_layout(
          fig,
          w_pad=w_pad,
          h_pad=h_pad,
          wspace=self._params["wspace"],
          hspace=self._params["hspace"],
          rect=self._params["rect"],
          compress=self._compress,
      )
  
imports: from contextlib import nullcontext
  import matplotlib
  from matplotlib._constrained_layout import do_constrained_layout
  from matplotlib._tight_layout import get_subplotspec_list, get_tight_layout_figure
label_desc: Use image node_id 2 for calling the ConstrainedLayoutEngine obj's underlying member method code with example usage: obj.execute(fig) and returns: do_constrained_layout