code: def _reshape_clusters(clusters, sample_shape):
      """Reshape cluster masks or indices to be of the correct shape."""
      # format of the bool mask and indices are ndarrays
      if len(clusters) > 0 and isinstance(clusters[0], np.ndarray):
          if clusters[0].dtype == np.dtype(bool):  # format of mask
              clusters = [c.reshape(sample_shape) for c in clusters]
          else:  # format of indices
              clusters = [
                  np.unravel_index(c, sample_shape) for c in clusters
              ]
      return clusters
  
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 32 for calling a global function with example usage: _reshape_clusters(clusters, sample_shape) and returns: clusters