code: def _gen_cmap_registry():
      """
      Generate a dict mapping standard colormap names to standard colormaps, as
      well as the reversed colormaps.
      """
      cmap_d = {**cmaps_listed}
      for name, spec in datad.items():
          cmap_d[name] = (  # Precache the cmaps at a fixed lutsize..
              colors.LinearSegmentedColormap(name, spec, _LUTSIZE)
              if "red" in spec
              else colors.ListedColormap(spec["listed"], name)
              if "listed" in spec
              else colors.LinearSegmentedColormap.from_list(
                  name, spec, _LUTSIZE
              )
          )
  
      # Register colormap aliases for gray and grey.
      cmap_d["grey"] = cmap_d["gray"]
      cmap_d["gist_grey"] = cmap_d["gist_gray"]
      cmap_d["gist_yerg"] = cmap_d["gist_yarg"]
      cmap_d["Grays"] = cmap_d["Greys"]
  
      # Generate reversed cmaps.
      for cmap in list(cmap_d.values()):
          rmap = cmap.reversed()
          cmap_d[rmap.name] = rmap
      return cmap_d
  
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 1 for calling a global function with example usage: _gen_cmap_registry() and returns: cmap_d