code: def set_layout_engine(
      fig: Figure,
      engine: Literal["constrained", "compressed", "tight", "none"],
  ) -> None:
      """Handle changes to auto layout engine interface in 3.6"""
      if hasattr(fig, "set_layout_engine"):
          fig.set_layout_engine(engine)
      else:
          # _version_predates(mpl, 3.6)
          if engine == "tight":
              fig.set_tight_layout(True)  # type: ignore  # predates typing
          elif engine == "constrained":
              fig.set_constrained_layout(True)  # type: ignore
          elif engine == "none":
              fig.set_tight_layout(False)  # type: ignore
              fig.set_constrained_layout(False)
  
file_path: seaborn/seaborn/_compat.py
imports: from __future__ import annotations
  from typing import Literal
  import numpy
  import matplotlib
  from matplotlib.figure import Figure
  from seaborn.utils import _version_predates
label_desc: Use image node_id 4 for calling a global function with example usage: set_layout_engine(fig, engine) without return types