code: def intensity_to_rgb(intensity, cmap="cubehelix", normalize=False):
      """
      Convert a 1-channel matrix of intensities to an RGB image employing a colormap.
      This function requires matplotlib. See `matplotlib colormaps
      <http://matplotlib.org/examples/color/colormaps_reference.html>`_ for a
      list of available colormap.
  
      Args:
          intensity (np.ndarray): array of intensities such as saliency.
          cmap (str): name of the colormap to use.
          normalize (bool): if True, will normalize the intensity so that it has
              minimum 0 and maximum 1.
  
      Returns:
          np.ndarray: an RGB float32 image in range [0, 255], a colored heatmap.
      """
      assert intensity.ndim == 2, intensity.shape
      intensity = intensity.astype("float")
  
      if normalize:
          intensity -= intensity.min()
          intensity /= intensity.max()
  
      cmap = plt.get_cmap(cmap)
      intensity = cmap(intensity)[..., :3]
      return intensity.astype("float32") * 255.0
  
file_path: tensorpack/tensorpack/utils/viz.py
imports: import numpy
  import os
  import sys
  from ..utils.develop import create_dummy_func
  from .argtools import shape2d
  from .fs import mkdir_p
label_desc: Use image node_id 7 for calling a global function with example usage: intensity_to_rgb(intensity, cmap, normalize) and returns: unknown