def assert_multi_index_is_product(testcase, index, *levels):
 testcase.assertIsInstance(index, MultiIndex, ('%s is not a MultiIndex' % index))
 testcase.assertEqual(set(index), set(product(*levels)))

def assert_multi_index_is_product ( testcase , index , * levels ) : testcase . assertIsInstance ( index , MultiIndex , ( '%s is not a MultiIndex' % index ) ) testcase . assertEqual ( set ( index ) , set ( product ( * levels ) ) )
assert that a multiindex contains the product of *levels .