code: def test_basic(df, npartitions):
      ddf = dd.from_pandas(df, npartitions=npartitions)
  
      approx = ddf.nunique_approx().compute(scheduler="sync")
      exact = len(df.drop_duplicates())
      assert (
          abs(approx - exact) <= 2 or abs(approx - exact) / exact < 0.05
      )
  
imports: from __future__ import annotations
  import numpy
  import pandas
  import pytest
  import dask.dataframe
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic(df, npartitions) without return types