code: def get_renderer(fig):
      if fig._cachedRenderer:
          renderer = fig._cachedRenderer
      else:
          canvas = fig.canvas
  
          if canvas and hasattr(canvas, "get_renderer"):
              renderer = canvas.get_renderer()
          else:
              # not sure if this can happen
              warnings.warn(
                  "tight_layout : falling back to Agg renderer"
              )
              from matplotlib.backends.backend_agg import (
                  FigureCanvasAgg,
              )
  
              canvas = FigureCanvasAgg(fig)
              renderer = canvas.get_renderer()
  
      return renderer
  
file_path: catboost/contrib/python/matplotlib/py2/matplotlib/tight_layout.py
imports: import warnings
  import matplotlib
  from matplotlib.transforms import TransformedBbox, Bbox
  from matplotlib.font_manager import FontProperties
label_desc: Use image node_id 6 for calling a global function with example usage: get_renderer(fig) and returns: renderer