code: def _pigtailed_cmap(cmap, swap_order=("green", "red", "blue")):
      """Make a new colormap by concatenating a colormap with its reverse."""
      orig_cdict = cmap._segmentdata.copy()
  
      cdict = dict()
      cdict["green"] = [
          (0.5 * (1 - p), c1, c2)
          for (p, c1, c2) in reversed(orig_cdict[swap_order[0]])
      ]
      cdict["blue"] = [
          (0.5 * (1 - p), c1, c2)
          for (p, c1, c2) in reversed(orig_cdict[swap_order[1]])
      ]
      cdict["red"] = [
          (0.5 * (1 - p), c1, c2)
          for (p, c1, c2) in reversed(orig_cdict[swap_order[2]])
      ]
  
      for color in ("red", "green", "blue"):
          cdict[color].extend(
              [
                  (0.5 * (1 + p), c1, c2)
                  for (p, c1, c2) in orig_cdict[color]
              ]
          )
  
      return cdict
  
file_path: nilearn/nilearn/plotting/cm.py
imports: import numpy
  from matplotlib import cm, colors, rcParams
label_desc: Use image node_id 3 for calling a global function with example usage: _pigtailed_cmap(cmap, swap_order) and returns: cdict