code: def test_analytical_moments_calculation(dtype, order, ndim):
      if ndim == 2:
          shape = (256, 256)
      elif ndim == 3:
          shape = (64, 64, 64)
      else:
          shape = (16,) * ndim
      rng = np.random.default_rng(1234)
      if np.dtype(dtype).kind in "iu":
          x = rng.integers(0, 256, shape, dtype=dtype)
      else:
          x = rng.standard_normal(shape, dtype=dtype)
      # setting center=None will use the analytical expressions
      m1 = moments_central(x, center=None, order=order)
      # providing explicit centroid will bypass the analytical code path
      m2 = moments_central(x, center=centroid(x), order=order)
      # ensure numeric and analytical central moments are close
      # TODO: np 2 failed w/ thresh = 1e-4
      thresh = 1.5e-4 if x.dtype == np.float32 else 1e-9
      compare_moments(m1, m2, thresh=thresh)
  
imports: import itertools
  import numpy
  import pytest
  from scipy import ndimage
  from skimage import draw
  from skimage._shared import testing
  from skimage._shared.testing import assert_allclose, assert_almost_equal, assert_equal
  from skimage._shared.utils import _supported_float_type
  from skimage.measure import centroid, inertia_tensor, inertia_tensor_eigvals, moments, moments_central, moments_coords, moments_coords_central, moments_hu, moments_normalized
label_desc: Use image node_id 10 for calling a global function with example usage: test_analytical_moments_calculation(dtype, order, ndim) without return types