code: def _process_cmap(cmap):
      """
      Returns a kwarg dict suitable for a ColorScale
      """
      option = {}
      if isinstance(cmap, str):
          option["scheme"] = cmap
      elif isinstance(cmap, list):
          option["colors"] = cmap
      else:
          raise ValueError(
              """`cmap` must be a string (name of a color scheme)
                           or a list of colors, but a value of {} was given
                           """.format(
                  cmap
              )
          )
      return option
  
imports: import sys
  from collections import OrderedDict
  from IPython.display import display
  from ipywidgets import Image
  from numpy import arange, issubdtype, array, column_stack, shape
  from .figure import Figure
  from bqscales import Scale, LinearScale, Mercator
  from .axes import Axis
  from .marks import Lines, Scatter, Hist, Bars, OHLC, Pie, Map, Image, Label, HeatMap, GridHeatMap, topo_load, Boxplot, Bins
  from .interacts import BrushIntervalSelector, FastIntervalSelector, BrushSelector, IndexSelector, MultiSelector, LassoSelector
  from traitlets.utils.sentinel import Sentinel
  import functools
label_desc: Use image node_id 19 for calling a global function with example usage: _process_cmap(cmap) and returns: option