code: def test_series_nunique(nan_as_null, dropna):
      # We remove nulls as opposed to NaNs using the dropna parameter,
      # so to test against pandas we replace NaN with another discrete value
      cudf_series = cudf.Series(
          [1, 2, 2, 3, 3], nan_as_null=nan_as_null
      )
      pd_series = pd.Series([1, 2, 2, 3, 3])
      expect = pd_series.nunique(dropna=dropna)
      got = cudf_series.nunique(dropna=dropna)
      assert expect == got
  
      cudf_series = cudf.Series(
          [1.0, 2.0, 3.0, np.nan, None], nan_as_null=nan_as_null
      )
      if nan_as_null is True:
          pd_series = pd.Series([1.0, 2.0, 3.0, np.nan, None])
      else:
          pd_series = pd.Series([1.0, 2.0, 3.0, -1.0, None])
  
      expect = pd_series.nunique(dropna=dropna)
      got = cudf_series.nunique(dropna=dropna)
      assert expect == got
  
      cudf_series = cudf.Series(
          [1.0, np.nan, np.nan], nan_as_null=nan_as_null
      )
      if nan_as_null is True:
          pd_series = pd.Series([1.0, np.nan, np.nan])
      else:
          pd_series = pd.Series([1.0, -1.0, -1.0])
      expect = pd_series.nunique(dropna=dropna)
      got = cudf_series.nunique(dropna=dropna)
      assert expect == got
  
imports: from concurrent.futures import ThreadPoolExecutor
  import cupy
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.datasets import randomdata
  from cudf.testing._utils import _create_cudf_series_float64_default, _create_pandas_series_float64_default, assert_eq, assert_exceptions_equal, expect_warning_if
label_desc: Use image node_id 5 for calling a global function with example usage: test_series_nunique(nan_as_null, dropna) without return types