code: def test_moments_central(anisotropic):
      image = np.zeros((20, 20), dtype=np.float64)
      image[14, 14] = 1
      image[15, 15] = 1
      image[14, 15] = 0.5
      image[15, 14] = 0.5
      if anisotropic:
          spacing = (2, 1)
      else:
          spacing = (1, 1)
      if anisotropic is None:
          mu = moments_central(image, (14.5, 14.5))
          # check for proper centroid computation
          mu_calc_centroid = moments_central(image)
      else:
          mu = moments_central(
              image,
              (14.5 * spacing[0], 14.5 * spacing[1]),
              spacing=spacing,
          )
          # check for proper centroid computation
          mu_calc_centroid = moments_central(image, spacing=spacing)
  
      compare_moments(mu, mu_calc_centroid, thresh=1e-14)
  
      # shift image by dx=2, dy=2
      image2 = np.zeros((20, 20), dtype=np.double)
      image2[16, 16] = 1
      image2[17, 17] = 1
      image2[16, 17] = 0.5
      image2[17, 16] = 0.5
      if anisotropic is None:
          mu2 = moments_central(image2, (14.5 + 2, 14.5 + 2))
      else:
          mu2 = moments_central(
              image2,
              ((14.5 + 2) * spacing[0], (14.5 + 2) * spacing[1]),
              spacing=spacing,
          )
      # central moments must be translation invariant
      compare_moments(mu, mu2, thresh=1e-14)
  
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 3 for calling a global function with example usage: test_moments_central(anisotropic) without return types