code: def _cleanup_agg():
      """Call close_event for Agg canvases to help our doc build."""
      import matplotlib.backends.backend_agg
      import matplotlib.figure
  
      for key in list(_event_channels):  # we might remove keys as we go
          if isinstance(key, matplotlib.figure.Figure):
              canvas = key.canvas
              if isinstance(
                  canvas,
                  matplotlib.backends.backend_agg.FigureCanvasAgg,
              ):
                  for cb in key.canvas.callbacks.callbacks[
                      "close_event"
                  ].values():
                      cb = cb()  # get the true ref
                      if cb is not None:
                          cb()
  
imports: import contextlib
  import re
  import weakref
  from dataclasses import dataclass
  from typing import Optional, Union
  from matplotlib.colors import Colormap
  from ..utils import _validate_type, fill_doc, logger, verbose, warn
label_desc: Use image node_id 8 for calling a global function with example usage: _cleanup_agg() without return types