code: def indices_from_dense(dense, validate=True):
      """
      Retrieve indices of a 'dense' matrix
  
      The return value is a python list of 1-dimensional ndarrays
      whose lengths may or may not be equal (non-homogeneous)
  
      A given index of the 'indices' list corresponds to the same index in the
      'label_idx' axis of the 'dense' matrix
      An element of the 'indices' list is a 1-dimensional ndarray of labels that
      are present in the 'dense' matrix, at that index
  
      e.g. the following 'indices' list:
      [array([1, 2, 4], dtype=uint8), array([3, 5], dtype=uint8)]
  
      specifies that its corresponding 'dense' matrix has a 'label_idx' dim = 2,
      i.e. a shape of: (2, c, t, z, y, x),
      where the labels '1', '2', '4' are present at index '0', and the labels '3'
      and '4' are present at index '1'
      """
      if validate:
          _validate_dense(dense)
  
      indices = [np.unique(d) for d in dense]
      indices = [idx[1:] if idx[0] == 0 else idx for idx in indices]
      return 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 6 for calling a global function with example usage: indices_from_dense(dense, validate) and returns: indices