code: def test_nunique(setup, check_ref_counts):
      data1 = pd.Series(np.random.randint(0, 5, size=(20,)))
  
      series = md.Series(data1)
      result = series.nunique().execute().fetch()
      expected = data1.nunique()
      assert result == expected
  
      series = md.Series(data1, chunk_size=6)
      result = series.nunique().execute().fetch()
      expected = data1.nunique()
      assert result == expected
  
      # test dropna
      data2 = data1.copy()
      data2[[2, 9, 18]] = np.nan
  
      series = md.Series(data2)
      result = series.nunique().execute().fetch()
      expected = data2.nunique()
      assert result == expected
  
      series = md.Series(data2, chunk_size=3)
      result = series.nunique(dropna=False).execute().fetch()
      expected = data2.nunique(dropna=False)
      assert result == expected
  
      # test dataframe
      data1 = pd.DataFrame(
          np.random.randint(0, 6, size=(20, 20)),
          columns=["c" + str(i) for i in range(20)],
      )
      df = md.DataFrame(data1)
      result = df.nunique().execute().fetch()
      expected = data1.nunique()
      pd.testing.assert_series_equal(result, expected)
  
      df = md.DataFrame(data1, chunk_size=6)
      result = df.nunique().execute().fetch()
      expected = data1.nunique()
      pd.testing.assert_series_equal(result, expected)
  
      df = md.DataFrame(data1)
      result = df.nunique(axis=1).execute().fetch()
      expected = data1.nunique(axis=1)
      pd.testing.assert_series_equal(result, expected)
  
      df = md.DataFrame(data1, chunk_size=3)
      result = df.nunique(axis=1).execute().fetch()
      expected = data1.nunique(axis=1)
      pd.testing.assert_series_equal(result, expected)
  
      # test dropna
      data2 = data1.copy()
      data2.iloc[[2, 9, 18], [2, 9, 18]] = np.nan
  
      df = md.DataFrame(data2)
      result = df.nunique().execute().fetch()
      expected = data2.nunique()
      pd.testing.assert_series_equal(result, expected)
  
      df = md.DataFrame(data2, chunk_size=3)
      result = df.nunique(dropna=False).execute().fetch()
      expected = data2.nunique(dropna=False)
      pd.testing.assert_series_equal(result, expected)
  
      df = md.DataFrame(data1, chunk_size=3)
      result = df.nunique(axis=1).execute().fetch()
      expected = data1.nunique(axis=1)
      pd.testing.assert_series_equal(result, expected)
  
imports: from typing import NamedTuple
  import numpy
  import pytest
  import pandas
  from ....None import dataframe
  from ....config import option_context
  from ....session import get_default_session
  from ....tests.core import require_cudf, require_cupy
  from ....utils import lazy_import, pd_release_version
  from ...None import CustomReduction, NamedAgg
  from ...base import to_gpu
label_desc: Use image node_id 13 for calling a global function with example usage: test_nunique(setup, check_ref_counts) without return types