code: def preset_gradient_to_colormap(name):
      # generate the hsv two gradients using makeHslCycle
      if name == "spectrum":
          # steps=30 for 300 degrees gives the same density as
          # the default steps=36 for 360 degrees
          cmap = colormap.makeHslCycle((0, 300 / 360), steps=30)
      elif name == "cyclic":
          cmap = colormap.makeHslCycle((1, 0))
      else:
          cmap = colormap.ColorMap(
              *zip(*Gradients[name]["ticks"]), name=name
          )
      return cmap
  
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 2 for calling a global function with example usage: preset_gradient_to_colormap(name) and returns: cmap