#NEWLINE# def reverseCMAP( cmap ) : #NEWLINE# #INDENT# reversed = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( value , name ) in cmap . items ( ) : #NEWLINE# #INDENT# if ( name not in reversed ) : #NEWLINE# #INDENT# reversed [ name ] = [ ] #NEWLINE# #UNINDENT# reversed [ name ] . append ( value ) #NEWLINE# #UNINDENT# return reversed