code: def test_moments(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 = (1.4, 2)
      else:
          spacing = (1, 1)
      if anisotropic is None:
          m = moments(image)
      else:
          m = moments(image, spacing=spacing)
      assert_equal(m[0, 0], 3)
      assert_almost_equal(m[1, 0] / m[0, 0], 14.5 * spacing[0])
      assert_almost_equal(m[0, 1] / m[0, 0], 14.5 * spacing[1])
  
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 2 for calling a global function with example usage: test_moments(anisotropic) without return types