code: def test_groupby_nunique(setup):
      rs = np.random.RandomState(0)
      data_size = 100
      data_dict = {
          "a": rs.randint(0, 10, size=(data_size,)),
          "b": rs.choice(list("abcd"), size=(data_size,)),
          "c": rs.choice(list("abcd"), size=(data_size,)),
      }
      df1 = pd.DataFrame(data_dict)
  
      # one chunk
      mdf = md.DataFrame(df1)
      pd.testing.assert_frame_equal(
          mdf.groupby("c").nunique().execute().fetch().sort_index(),
          df1.groupby("c").nunique().sort_index(),
      )
  
      # multiple chunks
      mdf = md.DataFrame(df1, chunk_size=13)
      pd.testing.assert_frame_equal(
          mdf.groupby("b").nunique().execute().fetch().sort_index(),
          df1.groupby("b").nunique().sort_index(),
      )
  
      # getitem and nunique
      mdf = md.DataFrame(df1, chunk_size=13)
      pd.testing.assert_series_equal(
          mdf.groupby("b")["a"]
          .nunique()
          .execute()
          .fetch()
          .sort_index(),
          df1.groupby("b")["a"].nunique().sort_index(),
      )
  
      # test with as_index=False
      mdf = md.DataFrame(df1, chunk_size=13)
      if _agg_size_as_frame:
          pd.testing.assert_frame_equal(
              mdf.groupby("b", as_index=False)["a"]
              .nunique()
              .execute()
              .fetch()
              .sort_values(by="b", ignore_index=True),
              df1.groupby("b", as_index=False)["a"]
              .nunique()
              .sort_values(by="b", ignore_index=True),
          )
  
imports: from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....config import option_context
  from ....core.operand import OperandStage
  from ....tests.core import assert_groupby_equal, require_cudf
  from ....utils import arrow_array_to_objects, pd_release_version
  from ...core import DATAFRAME_OR_SERIES_TYPE
  from ..aggregation import DataFrameGroupByAgg
label_desc: Use image node_id 20 for calling a global function with example usage: test_groupby_nunique(setup) without return types