code: def _get_colormap_from_array(
      colormap=None,
      normalized_colormap=False,
      default_colormap="coolwarm",
  ):
      from matplotlib.colors import ListedColormap
  
      if colormap is None:
          cmap = _get_cmap(default_colormap)
      elif isinstance(colormap, str):
          cmap = _get_cmap(colormap)
      elif normalized_colormap:
          cmap = ListedColormap(colormap)
      else:
          cmap = ListedColormap(np.array(colormap) / 255.0)
      return cmap
  
imports: import collections.abc
  import functools
  import os
  import platform
  import signal
  import sys
  from colorsys import rgb_to_hls
  from contextlib import contextmanager
  from ctypes import c_char_p, c_void_p, cdll
  from pathlib import Path
  import numpy
  from ...fixes import _compare_version
  from ...utils import _check_qt_version, _validate_type, logger, warn
  from ..utils import _get_cmap
label_desc: Use image node_id 1 for calling a global function with example usage: _get_colormap_from_array(colormap, normalized_colormap, default_colormap) and returns: cmap