code: def permutation_cluster_test(
      X,
      threshold=None,
      n_permutations=1024,
      tail=0,
      stat_fun=None,
      adjacency=None,
      n_jobs=None,
      seed=None,
      max_step=1,
      exclude=None,
      step_down_p=0,
      t_power=1,
      out_type="indices",
      check_disjoint=False,
      buffer_size=1000,
      verbose=None,
  ):
      """Cluster-level statistical permutation test.
  
      For a list of :class:`NumPy arrays <numpy.ndarray>` of data,
      calculate some statistics corrected for multiple comparisons using
      permutations and cluster-level correction. Each element of the list ``X``
      should contain the data for one group of observations (e.g., 2D arrays for
      time series, 3D arrays for time-frequency power values). Permutations are
      generated with random partitions of the data. For details, see
      :footcite:p:`MarisOostenveld2007,Sassenhagen2019`.
  
      Parameters
      ----------
      X : list of array, shape (n_observations, p[, q][, r])
          The data to be clustered. Each array in ``X`` should contain the
          observations for one group. The first dimension of each array is the
          number of observations from that group; remaining dimensions comprise
          the size of a single observation. For example if ``X = [X1, X2]``
          with ``X1.shape = (20, 50, 4)`` and ``X2.shape = (17, 50, 4)``, then
          ``X`` has 2 groups with respectively 20 and 17 observations in each,
          and each data point is of shape ``(50, 4)``. Note: that the
          *last dimension* of each element of ``X`` should correspond to the
          dimension represented in the ``adjacency`` parameter
          (e.g., spectral data should be provided as
          ``(observations, frequencies, channels/vertices)``).
      %(threshold_clust_f)s
      %(n_permutations_clust_int)s
      %(tail_clust)s
      %(stat_fun_clust_f)s
      %(adjacency_clust_n)s
      %(n_jobs)s
      %(seed)s
      %(max_step_clust)s
      %(exclude_clust)s
      %(step_down_p_clust)s
      %(f_power_clust)s
      %(out_type_clust)s
      %(check_disjoint_clust)s
      %(buffer_size_clust)s
      %(verbose)s
  
      Returns
      -------
      F_obs : array, shape (p[, q][, r])
          Statistic (F by default) observed for all variables.
      clusters : list
          List type defined by out_type above.
      cluster_pv : array
          P-value for each cluster.
      H0 : array, shape (n_permutations,)
          Max cluster level stats observed under permutation.
  
      Notes
      -----
      %(threshold_clust_f_notes)s
  
      References
      ----------
      .. footbibliography::
      """
      stat_fun, threshold = _check_fun(
          X, stat_fun, threshold, tail, "between"
      )
      return _permutation_cluster_test(
          X=X,
          threshold=threshold,
          n_permutations=n_permutations,
          tail=tail,
          stat_fun=stat_fun,
          adjacency=adjacency,
          n_jobs=n_jobs,
          seed=seed,
          max_step=max_step,
          exclude=exclude,
          step_down_p=step_down_p,
          t_power=t_power,
          out_type=out_type,
          check_disjoint=check_disjoint,
          buffer_size=buffer_size,
      )
  
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 26 for calling a global function with example usage: permutation_cluster_test(X, threshold, n_permutations, tail, stat_fun, adjacency, n_jobs, seed, max_step, exclude, step_down_p, t_power, out_type, check_disjoint, buffer_size, verbose) and returns: _permutation_cluster_test