code: def _validate_dense(dense):
      """
      A 'dense' matrix is a 6 dimensional array with axis order:
      (label_idx, c, t, z, y, x)
  
      When the 'label_idx' dim = 1, it hosts zero or more non-overlapping labels
      When the 'label_idx' dim > 1, each index hosts one or more non-overlapping
      labels (within that index)
      In other words, while labels within an index of 'label_idx' are never
      overlapping, labels between indices of 'label_idx' would overlap
      i.e. 'dense.sum(axis=0)' is invalid, producing innaccurate labels
  
      A 'dense' matrix is usually paired with an array of indices specifying
      which label values are present in which index of the 'label_idx' dim
      (see 'indices_from_dense' for more details)
      """
      ndim = len(DENSE_AXIS_NAMES)
      assert type(dense) == np.ndarray, "dense must be ndarray"
      assert (
          dense.ndim == ndim
      ), f"dense must be {ndim}-dimensional - f{DENSE_AXIS_NAMES}"
  
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 1 for calling a global function with example usage: _validate_dense(dense) without return types