code: def slow_labeled_max(array, labeled):
      return np.array(
          [
              np.max(array * (labeled == i))
              for i in range(labeled.max() + 1)
          ]
      )
  
imports: import numpy
  import mahotas
  import mahotas.labeled
  from pytest import raises
label_desc: Use image node_id 5 for calling a global function with example usage: slow_labeled_max(array, labeled) and returns: np