code: def test_digitize(bins_type):
      x = cupy.array([2, 4, 5, 6, 1])
      bins = bins_type.array([1, 2, 3, 4, 5])
      for chunks in [2, 4]:
          for right in [False, True]:
              d = da.from_array(x, chunks=chunks)
              bins_cupy = cupy.array(bins)
              assert_eq(
                  da.digitize(d, bins, right=right),
                  np.digitize(x, bins_cupy, right=right),
                  check_type=False,
              )
  
      x = cupy.random.default_rng().random(size=(100, 100))
      bins = bins_type.random.default_rng().random(size=13)
      bins.sort()
      for chunks in [(10, 10), (10, 20), (13, 17), (87, 54)]:
          for right in [False, True]:
              d = da.from_array(x, chunks=chunks)
              bins_cupy = cupy.array(bins)
              assert_eq(
                  da.digitize(d, bins, right=right),
                  np.digitize(x, bins_cupy, right=right),
              )
  
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 6 for calling a global function with example usage: test_digitize(bins_type) without return types