code: def test_digitize_execution(setup):
      data = np.array([0.2, 6.4, 3.0, 1.6])
      x = tensor(data, chunk_size=2)
      bins = np.array([0.0, 1.0, 2.5, 4.0, 10.0])
      inds = digitize(x, bins)
  
      res = inds.execute().fetch()
      expected = np.digitize(data, bins)
      np.testing.assert_equal(res, expected)
  
      b = tensor(bins, chunk_size=2)
      inds = digitize(x, b)
  
      res = inds.execute().fetch()
      expected = np.digitize(data, bins)
      np.testing.assert_equal(res, expected)
  
      data = np.array([1.2, 10.0, 12.4, 15.5, 20.0])
      x = tensor(data, chunk_size=2)
      bins = np.array([0, 5, 10, 15, 20])
      inds = digitize(x, bins, right=True)
  
      res = inds.execute().fetch()
      expected = np.digitize(data, bins, right=True)
      np.testing.assert_equal(res, expected)
  
      inds = digitize(x, bins, right=False)
  
      res = inds.execute().fetch()
      expected = np.digitize(data, bins, right=False)
      np.testing.assert_equal(res, expected)
  
      data = sps.random(10, 1, density=0.1) * 12
      x = tensor(data, chunk_size=2)
      bins = np.array([1.0, 2.0, 2.5, 4.0, 10.0])
      inds = digitize(x, bins)
  
      res = inds.execute().fetch()
      expected = np.digitize(data.toarray(), bins, right=False)
      np.testing.assert_equal(res.toarray(), expected)
  
imports: import numpy
  import scipy.sparse
  import pytest
  from ....utils import ignore_warning
  from ...datasource import arange, tensor, empty
  from ...base import sort
  from ...merge import stack
  from ...reduction import all
  from ..None import average, bincount, cov, corrcoef, ptp, digitize, histogram_bin_edges, histogram, quantile, percentile, median
  from ..quantile import INTERPOLATION_TYPES
label_desc: Use image node_id 5 for calling a global function with example usage: test_digitize_execution(setup) without return types