code: def _setup_qt(tb):
      from matplotlib.backends.qt_compat import QtGui, QtWidgets
  
      menu = QtWidgets.QMenu()
      try:
          QActionGroup = QtGui.QActionGroup  # Qt6
      except AttributeError:
          QActionGroup = QtWidgets.QActionGroup  # Qt5
      group = QActionGroup(menu)
      group.triggered.connect(
          lambda action: _set_menu_entry(tb, action.text())
      )
  
      for name in _MENU_ENTRIES:
          action = menu.addAction(name)
          action.setCheckable(True)
          action.setActionGroup(group)
          action.setChecked(name == "None")
  
      actions = tb.actions()
      before = next(
          (
              action
              for action in actions
              if isinstance(
                  tb.widgetForAction(action), QtWidgets.QLabel
              )
          ),
          None,
      )
  
      tb.insertSeparator(before)
      button = QtWidgets.QToolButton()
      # FIXME: _icon needs public API.
      button.setIcon(
          tb._icon(str(Path(__file__).parent / "images/eye.png"))
      )
      button.setText(_BUTTON_NAME)
      button.setToolTip(_BUTTON_HELP)
      button.setPopupMode(
          QtWidgets.QToolButton.ToolButtonPopupMode.InstantPopup
      )
      button.setMenu(menu)
      tb.insertWidget(before, button)
  
file_path: matplotlib/galleries/examples/user_interfaces/mplcvd.py
imports: import functools
  from pathlib import Path
  import colorspacious
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: _setup_qt(tb) without return types