code: def indices_from_ijv(ijv, validate=True):
      """
      Get the indices for a scipy.ndimage-style function from the 'ijv' formatted
      segmented labels
      """
      if validate:
          _validate_ijv(ijv)
  
      if len(ijv) == 0:
          return np.zeros(0, np.int32)
  
      max_label = np.max(ijv[:, 2])
  
      return np.arange(max_label).astype(np.int32) + 1
  
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 8 for calling a global function with example usage: indices_from_ijv(ijv, validate) and returns: unknown, np