code: def get_plotnine_tight_layout(pack: LayoutPack) -> TightParams:
      """
      Compute tight layout parameters
      """
      spaces = LRTBSpaces(pack)
      parts = calculate_panel_spacing(pack, spaces)
      params = TightParams(spaces, parts.wspace, parts.hspace)
      ratio = pack.facet._aspect_ratio()
      if ratio is not None:
          params = params.to_aspect_ratio(pack.facet, ratio, parts)
      return params
  
file_path: plotnine/plotnine/_mpl/_plotnine_tight_layout.py
imports: from __future__ import annotations
  import typing
  from copy import deepcopy
  from dataclasses import dataclass
  from matplotlib.offsetbox import AnchoredOffsetbox
  from ._plot_side_space import LRTBSpaces, WHSpaceParts, calculate_panel_spacing
label_desc: Use image node_id 1 for calling a global function with example usage: get_plotnine_tight_layout(pack) and returns: params