def make_encoding_map(decoding_map):
 m = {}
 for (k, v) in decoding_map.items():
  if (not (v in m)):
   m[v] = k
  else:
   m[v] = None
 return m

def make_encoding_map ( decoding_map ) : m = { } for ( k , v ) in decoding_map . items ( ) : if ( not ( v in m ) ) : m [ v ] = k else : m [ v ] = None return m
creates an encoding map from a decoding map .