code: def test_labels():
      R = (255 * np.random.rand(128, 256)).astype(np.uint16)
      labels = np.zeros(R.shape, np.intc)
      labels[100:, :] += 1
      labels[100:, 100:] += 1
      centres = mahotas.center_of_mass(R, labels)
      for label, cm in enumerate(centres):
          assert np.all(
              cm == mahotas.center_of_mass(R * (labels == label))
          )
  
file_path: mahotas/mahotas/tests/test_center_of_mass.py
imports: import numpy
  from scipy import ndimage
  import mahotas.center_of_mass
label_desc: Use image node_id 6 for calling a global function with example usage: test_labels() without return types