code: def test_normalize():
      A, B = np.meshgrid(np.arange(128), np.arange(128))
      for p0, p1 in [(1, 1), (1, 2), (2, 1), (2, 2)]:
  
          def f(im):
              return moments(
                  im, p0, p1, cm=mh.center_of_mass(im), normalize=1
              )
  
          im = A + B
          fs = [f(im), f(im[::2]), f(im[:, ::2]), f(im[::2, ::2])]
          assert np.var(fs) < np.mean(np.abs(fs)) / 10
  
file_path: mahotas/mahotas/tests/test_moments.py
imports: import numpy
  import mahotas
  from mahotas.features.moments import moments
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_normalize() and returns: moments