code: def center_of_labels_mass(labels, validate=True):
      if validate:
          _validate_labels(labels)
  
      indices = indices_from_labels(labels)
      return np.array(
          scipy.ndimage.center_of_mass(
              np.ones_like(labels), labels, indices
          )
      )
  
imports: from enum import Enum
  import numpy
  from numpy.random.mtrand import RandomState
  import scipy.sparse
  import centrosome.index
label_desc: Use image node_id 26 for calling a global function with example usage: center_of_labels_mass(labels, validate) and returns: np