code: def boilerplate_gen():
      """Generator of lines for the automated part of pyplot."""
  
      _figure_commands = (
          "figimage",
          "figtext:text",
          "gca",
          "gci:_gci",
          "ginput",
          "subplots_adjust",
          "suptitle",
          "tight_layout",
          "waitforbuttonpress",
      )
  
      # These methods are all simple wrappers of Axes methods by the same name.
      _axes_commands = (
          "acorr",
          "angle_spectrum",
          "annotate",
          "arrow",
          "autoscale",
          "axhline",
          "axhspan",
          "axis",
          "axline",
          "axvline",
          "axvspan",
          "bar",
          "barbs",
          "barh",
          "bar_label",
          "boxplot",
          "broken_barh",
          "clabel",
          "cohere",
          "contour",
          "contourf",
          "csd",
          "ecdf",
          "errorbar",
          "eventplot",
          "fill",
          "fill_between",
          "fill_betweenx",
          "grid",
          "hexbin",
          "hist",
          "stairs",
          "hist2d",
          "hlines",
          "imshow",
          "legend",
          "locator_params",
          "loglog",
          "magnitude_spectrum",
          "margins",
          "minorticks_off",
          "minorticks_on",
          "pcolor",
          "pcolormesh",
          "phase_spectrum",
          "pie",
          "plot",
          "plot_date",
          "psd",
          "quiver",
          "quiverkey",
          "scatter",
          "semilogx",
          "semilogy",
          "specgram",
          "spy",
          "stackplot",
          "stem",
          "step",
          "streamplot",
          "table",
          "text",
          "tick_params",
          "ticklabel_format",
          "tricontour",
          "tricontourf",
          "tripcolor",
          "triplot",
          "violinplot",
          "vlines",
          "xcorr",
          # pyplot name : real name
          "sci:_sci",
          "title:set_title",
          "xlabel:set_xlabel",
          "ylabel:set_ylabel",
          "xscale:set_xscale",
          "yscale:set_yscale",
      )
  
      cmappable = {
          "contour": (
              "if __ret._A is not None:  # type: ignore[attr-defined]\n"
              "        sci(__ret)"
          ),
          "contourf": (
              "if __ret._A is not None:  # type: ignore[attr-defined]\n"
              "        sci(__ret)"
          ),
          "hexbin": "sci(__ret)",
          "scatter": "sci(__ret)",
          "pcolor": "sci(__ret)",
          "pcolormesh": "sci(__ret)",
          "hist2d": "sci(__ret[-1])",
          "imshow": "sci(__ret)",
          "spy": "if isinstance(__ret, cm.ScalarMappable): sci(__ret)  # noqa",
          "quiver": "sci(__ret)",
          "specgram": "sci(__ret[-1])",
          "streamplot": "sci(__ret.lines)",
          "tricontour": (
              "if __ret._A is not None:  # type: ignore[attr-defined]\n"
              "        sci(__ret)"
          ),
          "tricontourf": (
              "if __ret._A is not None:  # type: ignore[attr-defined]\n"
              "        sci(__ret)"
          ),
          "tripcolor": "sci(__ret)",
      }
  
      for spec in _figure_commands:
          if ":" in spec:
              name, called_name = spec.split(":")
          else:
              name = called_name = spec
          yield generate_function(
              name, f"Figure.{called_name}", FIGURE_METHOD_TEMPLATE
          )
  
      for spec in _axes_commands:
          if ":" in spec:
              name, called_name = spec.split(":")
          else:
              name = called_name = spec
  
          template = (
              AXES_CMAPPABLE_METHOD_TEMPLATE
              if name in cmappable
              else AXES_METHOD_TEMPLATE
          )
          yield generate_function(
              name,
              f"Axes.{called_name}",
              template,
              sci_command=cmappable.get(name),
          )
  
      cmaps = (
          "autumn",
          "bone",
          "cool",
          "copper",
          "flag",
          "gray",
          "hot",
          "hsv",
          "jet",
          "pink",
          "prism",
          "spring",
          "summer",
          "winter",
          "magma",
          "inferno",
          "plasma",
          "viridis",
          "nipy_spectral",
      )
      # add all the colormaps (autumn, hsv, ....)
      for name in cmaps:
          yield AUTOGEN_MSG
          yield CMAP_TEMPLATE.format(name=name)
  
imports: import ast
  from enum import Enum
  import functools
  import inspect
  from inspect import Parameter
  from pathlib import Path
  import sys
  import subprocess
  import numpy
  from matplotlib import _api, mlab
  from matplotlib.axes import Axes
  from matplotlib.backend_bases import MouseButton
  from matplotlib.figure import Figure
label_desc: Use image node_id 3 for calling a global function with example usage: boilerplate_gen() without return types