def test_colormap_reversing():
 for name in cm.cmap_d:
  cmap = plt.get_cmap(name)
  cmap_r = cmap.reversed()
  if (not cmap_r._isinit):
   cmap._init()
   cmap_r._init()
  assert_array_almost_equal(cmap._lut[:(-3)], cmap_r._lut[(-4)::(-1)])

def test_colormap_reversing ( ) : for name in cm . cmap_d : cmap = plt . get_cmap ( name ) cmap_r = cmap . reversed ( ) if ( not cmap_r . _isinit ) : cmap . _init ( ) cmap_r . _init ( ) assert_array_almost_equal ( cmap . _lut [ : ( - 3 ) ] , cmap_r . _lut [ ( - 4 ) : : ( - 1 ) ] )
check the generated _lut data of a colormap and corresponding reversed colormap if they are almost the same .