code: def test_get_colormap_from_array():
      """Test setting a colormap."""
      from matplotlib.colors import (
          LinearSegmentedColormap,
          ListedColormap,
      )
  
      cmap = _get_colormap_from_array()
      assert isinstance(cmap, LinearSegmentedColormap)
      cmap = _get_colormap_from_array(colormap="viridis")
      assert isinstance(cmap, ListedColormap)
      cmap = _get_colormap_from_array(
          colormap=[1, 1, 1], normalized_colormap=True
      )
      assert isinstance(cmap, ListedColormap)
      cmap = _get_colormap_from_array(
          colormap=[255, 255, 255], normalized_colormap=False
      )
      assert isinstance(cmap, ListedColormap)
  
file_path: mne-python/mne/viz/backends/tests/test_utils.py
imports: import platform
  from colorsys import rgb_to_hls
  from contextlib import nullcontext
  import numpy
  import pytest
  from mne import create_info
  from mne.io import RawArray
  from mne.utils import _check_qt_version
  from mne.viz.backends._utils import _check_color, _get_colormap_from_array, _pixmap_to_ndarray, _qt_is_dark
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_colormap_from_array() without return types