code: def test_unique_kwargs(return_index, return_inverse, return_counts):
      kwargs = dict(
          return_index=return_index,
          return_inverse=return_inverse,
          return_counts=return_counts,
      )
  
      a = cupy.array([1, 2, 4, 4, 5, 2])
      d = da.from_array(a, chunks=(3,))
  
      def _test_unique_kwargs():
          r_a = np.unique(a, **kwargs)
          r_d = da.unique(d, **kwargs)
  
          if not any([return_index, return_inverse, return_counts]):
              assert isinstance(r_a, cupy.ndarray)
              assert isinstance(r_d, da.Array)
  
              r_a = (r_a,)
              r_d = (r_d,)
  
          assert len(r_a) == len(r_d)
  
          if return_inverse:
              i = 1 + int(return_index)
              assert (d.size,) == r_d[i].shape
  
          for e_r_a, e_r_d in zip(r_a, r_d):
              assert_eq(e_r_d, e_r_a)
  
      # `return_index`, `return_inverse` and `return_counts` are currently
      # unsupported on CuPy-backed Dask arrays.
      if any(kwargs.values()):
          with pytest.raises(ValueError):
              _test_unique_kwargs()
  
file_path: dask/dask/array/tests/test_cupy_routines.py
imports: from __future__ import annotations
  import numpy
  import pytest
  from packaging.version import parse
  import dask.array
  from dask.array.utils import assert_eq, same_keys
label_desc: Use image node_id 9 for calling a global function with example usage: test_unique_kwargs(return_index, return_inverse, return_counts) without return types