code: def revcmap(data):
      """Can only handle specification *data* in dictionary format."""
      data_r = {}
      for key, val in six.iteritems(data):
          if callable(val):
              valnew = _reverser(val)
              # This doesn't work: lambda x: val(1-x)
              # The same "val" (the first one) is used
              # each time, so the colors are identical
              # and the result is shades of gray.
          else:
              # Flip x and exchange the y values facing x = 0 and x = 1.
              valnew = [
                  (1.0 - x, y1, y0) for x, y0, y1 in reversed(val)
              ]
          data_r[key] = valnew
      return data_r
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import numpy
  from numpy import ma
  import matplotlib
  import matplotlib.colors
  import matplotlib.cbook
  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: revcmap(data) and returns: data_r