code: def test_shade_rescale_discrete_levels(agg, attr, rescale):
      x = getattr(agg, attr)
      cmap = ["pink", "red"]
      img = tf.shade(
          x, cmap=cmap, how="eq_hist", rescale_discrete_levels=rescale
      )
      if rescale:
          sol = np.array(
              [
                  [0xFF8981FF, 0xFF6D67FF, 0xFF524DFF],
                  [0xFF3633FF, 0xFF8981FF, 0xFF1B19FF],
                  [0xFF0000FF, 0xFF8981FF, 0xFF8981FF],
              ],
              dtype="uint32",
          )
      else:
          sol = np.array(
              [
                  [0xFFCBC0FF, 0xFFA299FF, 0xFF7973FF],
                  [0xFF514CFF, 0xFFCBC0FF, 0xFF2826FF],
                  [0xFF0000FF, 0xFFCBC0FF, 0xFFCBC0FF],
              ],
              dtype="uint32",
          )
      sol = tf.Image(sol, coords=coords, dims=dims)
      assert_eq_xr(img, sol)
  
imports: from __future__ import annotations
  from io import BytesIO
  import numpy
  import xarray
  import dask.array
  import PIL
  import pytest
  import datashader.transfer_functions
  from datashader.tests.test_pandas import assert_eq_ndarray, assert_eq_xr, assert_image_close
label_desc: Use image node_id 16 for calling a global function with example usage: test_shade_rescale_discrete_levels(agg, attr, rescale) without return types