code: def _cluster_mask_to_indices(components, shape):
      """Convert to the old format of clusters, which were bool arrays."""
      for ci, c in enumerate(components):
          if isinstance(c, np.ndarray):  # mask
              components[ci] = np.where(c.reshape(shape))
          elif isinstance(c, slice):
              components[ci] = np.arange(c.start, c.stop)
          else:
              assert isinstance(c, tuple), type(c)
              c = list(c)  # tuple->list
              for ii, cc in enumerate(c):
                  if isinstance(cc, slice):
                      c[ii] = np.arange(cc.start, cc.stop)
                  else:
                      c[ii] = np.where(cc)[0]
              components[ci] = tuple(c)
      return components
  
imports: import numpy
  from scipy import ndimage, sparse
  from scipy.sparse.csgraph import connected_components
  from scipy.stats import f
  from scipy.stats import t
  from ..fixes import has_numba, jit
  from ..parallel import parallel_func
  from ..source_estimate import MixedSourceEstimate, SourceEstimate, VolSourceEstimate
  from ..source_space import SourceSpaces
  from ..utils import ProgressBar, _check_option, _pl, _validate_type, check_random_state, logger, split_list, verbose, warn
  from .parametric import f_oneway, ttest_1samp_no_p
label_desc: Use image node_id 17 for calling a global function with example usage: _cluster_mask_to_indices(components, shape) and returns: components