code: def test_shade_all_masked(empty_array):
      # Issue #1166, return early with array of all nans if all of data is masked out.
      # Before the fix this test results in:
      #   IndexError: index -1 is out of bounds for axis 0 with size 0
      agg = xr.DataArray(
          data=empty_array,
          coords=dict(y=[0, 1], x=[0, 1], cat=["a", "b"]),
      )
      im = tf.shade(agg, how="eq_hist", cmap=["white", "white"])
      assert isinstance(im.data, np.ndarray)
      assert im.shape == (2, 2)
  
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 18 for calling a global function with example usage: test_shade_all_masked(empty_array) without return types