code: def test_percentile():
      d = da.from_array(cupy.ones((16,)), chunks=(4,))
      qs = np.array([0, 50, 100])
  
      result = da.percentile(d, qs, method="midpoint")
      assert_eq(
          result, np.array([1, 1, 1], dtype=d.dtype), check_type=False
      )
  
      x = cupy.array([0, 0, 5, 5, 5, 5, 20, 20])
      d = da.from_array(x, chunks=(3,))
  
      result = da.percentile(d, qs, method="midpoint")
      assert_eq(
          result,
          np.array([0, 5, 20], dtype=result.dtype),
          check_type=False,
      )
  
      assert not same_keys(
          da.percentile(d, qs, "midpoint"),
          da.percentile(d, [0, 50], "midpoint"),
      )
  
file_path: dask/dask/array/tests/test_cupy_percentile.py
imports: from __future__ import annotations
  import numpy
  import pytest
  import dask.array
  from dask.array.utils import assert_eq, same_keys
label_desc: Use image node_id 1 for calling a global function with example usage: test_percentile() without return types