def unique_id_map(seqs):
 groups = invert_dict(seqs)
 result = {}
 for v in groups.values():
  for i in v:
   result[i] = v[0]
 return result

def unique_id_map ( seqs ) : groups = invert_dict ( seqs ) result = { } for v in groups . values ( ) : for i in v : result [ i ] = v [ 0 ] return result
returns map of seqs:unique representatives .