def _cmp_perm_lists(first, second):
 return ({tuple(a) for a in first} == {tuple(a) for a in second})

def _cmp_perm_lists ( first , second ) : return ( { tuple ( a ) for a in first } == { tuple ( a ) for a in second } )
compare two lists of permutations as sets .