code: def register_cmap(name=None, cmap=None, *, override_builtin=False):
      """
      Add a colormap to the set recognized by :func:`get_cmap`.
  
      Register a new colormap to be accessed by name ::
  
          LinearSegmentedColormap('swirly', data, lut)
          register_cmap(cmap=swirly_cmap)
  
      Parameters
      ----------
      name : str, optional
         The name that can be used in :func:`get_cmap` or :rc:`image.cmap`
  
         If absent, the name will be the :attr:`~matplotlib.colors.Colormap.name`
         attribute of the *cmap*.
  
      cmap : matplotlib.colors.Colormap
         Despite being the second argument and having a default value, this
         is a required argument.
  
      override_builtin : bool
  
          Allow built-in colormaps to be overridden by a user-supplied
          colormap.
  
          Please do not use this unless you are sure you need it.
      """
      _api.check_isinstance((str, None), name=name)
      if name is None:
          try:
              name = cmap.name
          except AttributeError as err:
              raise ValueError(
                  "Arguments must include a name or a " "Colormap"
              ) from err
      # override_builtin is allowed here for backward compatibility
      # this is just a shim to enable that to work privately in
      # the global ColormapRegistry
      _colormaps._allow_override_builtin = override_builtin
      _colormaps.register(cmap, name=name, force=override_builtin)
      _colormaps._allow_override_builtin = False
  
imports: from collections.abc import Mapping
  import functools
  import numpy
  from numpy import ma
  import matplotlib
  from matplotlib import _api, colors, cbook, scale
  from matplotlib._cm import datad
  from matplotlib._cm_listed import cmaps
label_desc: Use image node_id 2 for calling a global function with example usage: register_cmap(name, cmap) without return types