code: def test_groupby_nunique_multiindex(setup, gen_data2):
      df = gen_data2
      mdf = md.DataFrame(df, chunk_size=13)
  
      r1 = (
          mdf.groupby(["b", "c"], sort=False)["a", "d"]
          .nunique(method="tree")
          .execute()
          .fetch()
      )
      r2 = (
          mdf.groupby(["b", "c"], sort=False)["a", "d"]
          .nunique(method="shuffle")
          .execute()
          .fetch()
          .sort_values(by=["b", "c"])
          .reset_index()
      )
      r3 = (
          mdf.groupby(["b", "c"], sort=False)["a", "d"]
          .nunique(method="auto")
          .execute()
          .fetch()
          .sort_values(by=["b", "c"])
          .reset_index()
      )
  
      expected = df.groupby(["b", "c"], sort=False)["a", "d"].nunique()
      pd.testing.assert_frame_equal(r1, expected)
      pd.testing.assert_frame_equal(
          r2, expected.sort_values(by=["b", "c"]).reset_index()
      )
      pd.testing.assert_frame_equal(
          r3, expected.sort_values(by=["b", "c"]).reset_index()
      )
  
file_path: mars/mars/dataframe/groupby/tests/test_groupby_nunique_execution.py
imports: import numpy
  import pandas
  import pytest
  from ....None import dataframe
label_desc: Use image node_id 9 for calling a global function with example usage: test_groupby_nunique_multiindex(setup, gen_data2) without return types