code: def test_pyramid_reduce_nd():
      for ndim in [1, 2, 3, 4]:
          img = np.random.randn(*((8,) * ndim))
          out = pyramids.pyramid_reduce(
              img, downscale=2, channel_axis=None
          )
          expected_shape = np.asarray(img.shape) / 2
          assert_array_equal(out.shape, expected_shape)
  
imports: import math
  import pytest
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_equal, assert_equal
  from skimage import data
  from skimage._shared.utils import _supported_float_type
  from skimage.transform import pyramids
label_desc: Use image node_id 4 for calling a global function with example usage: test_pyramid_reduce_nd() without return types