def test_multiset_partitions_versions():
 multiplicities = [5, 2, 2, 1]
 m = MultisetPartitionTraverser()
 for (s1, s2) in zip_longest(m.enum_all(multiplicities), multiset_partitions_taocp(multiplicities)):
  assert compare_multiset_states(s1, s2)

def test_multiset_partitions_versions ( ) : multiplicities = [ 5 , 2 , 2 , 1 ] m = MultisetPartitionTraverser ( ) for ( s1 , s2 ) in zip_longest ( m . enum_all ( multiplicities ) , multiset_partitions_taocp ( multiplicities ) ) : assert compare_multiset_states ( s1 , s2 )
compares knuth-based versions of multiset_partitions .