def make_equiv(lo, li):
 seeno = OrderedDict()
 left = []
 right = []
 for (o, i) in zip(lo, li):
  if (o in seeno):
   left += [i]
   right += [o]
  else:
   seeno[o] = i
 return (left, right)

def make_equiv ( lo , li ) : seeno = OrderedDict ( ) left = [ ] right = [ ] for ( o , i ) in zip ( lo , li ) : if ( o in seeno ) : left += [ i ] right += [ o ] else : seeno [ o ] = i return ( left , right )
builds a dictionary of equivalences between inner inputs based on the equivalence of their corresponding outer inputs .