code: def compare_multiset_w_baseline(multiplicities):
      """
      Enumerates the partitions of multiset with AOCP algorithm and
      baseline implementation, and compare the results.
  
      """
      letters = "abcdefghijklmnopqrstuvwxyz"
      bl_partitions = multiset_partitions_baseline(
          multiplicities, letters
      )
  
      # The partitions returned by the different algorithms may have
      # their parts in different orders.  Also, they generate partitions
      # in different orders.  Hence the sorting, and set comparison.
  
      aocp_partitions = set()
      for state in multiset_partitions_taocp(multiplicities):
          p1 = tuple(
              sorted([tuple(p) for p in list_visitor(state, letters)])
          )
          aocp_partitions.add(p1)
  
      assert bl_partitions == aocp_partitions
  
file_path: sympy/sympy/utilities/tests/test_enumerative.py
imports: from itertools import zip_longest
  from sympy.utilities.enumerative import list_visitor, MultisetPartitionTraverser, multiset_partitions_taocp
  from sympy.utilities.iterables import _set_partitions
label_desc: Use image node_id 3 for calling a global function with example usage: compare_multiset_w_baseline(multiplicities) without return types