code: def slow_center_of_mass(img):
      """
      Returns the center of mass of img.
      """
      xs = []
      for axis, si in enumerate(img.shape):
          xs.append(np.mean(_mean_out(img, axis) * np.arange(si)))
      xs = np.array(xs)
      xs /= img.mean()
      return xs
  
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 2 for calling a global function with example usage: slow_center_of_mass(img) and returns: xs