code: def _get_decomp_test_data(function, ndim=2):
      if function == "binary_erosion":
          img = np.ones((17,) * ndim, dtype=np.uint8)
          img[8, 8] = 0
      elif function == "binary_dilation":
          img = np.zeros((17,) * ndim, dtype=np.uint8)
          img[8, 8] = 1
      else:
          img = data.binary_blobs(32, n_dim=ndim, rng=1)
      return img
  
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal, assert_equal
  from scipy import ndimage
  from skimage import data, color, morphology
  from skimage.util import img_as_bool
  from skimage.morphology import binary, footprints, gray
label_desc: Use image node_id 8 for calling a global function with example usage: _get_decomp_test_data(function, ndim) and returns: img