code: def __init__(self, showGradientSubMenu=False):
      super().__init__()
  
      topmenu = self
      act = topmenu.addAction("None")
      act.setData((None, None))
      topmenu.addSeparator()
  
      if showGradientSubMenu:
          submenu = topmenu.addMenu("preset gradient")
          submenu.aboutToShow.connect(self.buildGradientSubMenu)
  
      submenu = topmenu.addMenu("local")
      submenu.aboutToShow.connect(self.buildLocalSubMenu)
  
      # render the submenus only if the user actually clicks on it
  
      have_colorcet = importlib.util.find_spec("colorcet") is not None
  
      # the local cet files are a subset of the colorcet module.
      # expose just one of them.
      if not have_colorcet:
          submenu = topmenu.addMenu("cet (local)")
          submenu.aboutToShow.connect(self.buildCetLocalSubMenu)
      else:
          submenu = topmenu.addMenu("cet (external)")
          submenu.aboutToShow.connect(self.buildCetExternalSubMenu)
  
      if importlib.util.find_spec("matplotlib") is not None:
          submenu = topmenu.addMenu("matplotlib")
          submenu.aboutToShow.connect(self.buildMatplotlibSubMenu)
  
      if have_colorcet:
          submenu = topmenu.addMenu("colorcet")
          submenu.aboutToShow.connect(self.buildColorcetSubMenu)
  
imports: import importlib.util
  import re
  import numpy
  from ..None import colormap
  from ..None import functions
  from ..graphicsItems.GradientPresets import Gradients
  from ..Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 1 to create a new ColorMapMenu object from inherited base classes: QtWidgets with example: obj = ColorMapMenu(showGradientSubMenu)