code: def test_cluster_permutation_test(numba_conditional):
      """Test cluster level permutations tests."""
      (
          condition1_1d,
          condition2_1d,
          condition1_2d,
          condition2_2d,
      ) = _get_conditions()
      for condition1, condition2 in zip(
          (condition1_1d, condition1_2d), (condition2_1d, condition2_2d)
      ):
          (
              T_obs,
              clusters,
              cluster_p_values,
              hist,
          ) = permutation_cluster_test(
              [condition1, condition2],
              n_permutations=100,
              tail=1,
              seed=1,
              buffer_size=None,
              out_type="mask",
          )
          p_min = np.min(cluster_p_values)
          assert_equal(np.sum(cluster_p_values < 0.05), 1)
          assert_allclose(p_min, 0.01, atol=1e-6)
  
          # test with 2 jobs and buffer_size enabled
          buffer_size = condition1.shape[1] // 10
          (
              T_obs,
              clusters,
              cluster_p_values_buff,
              hist,
          ) = permutation_cluster_test(
              [condition1, condition2],
              n_permutations=100,
              tail=1,
              seed=1,
              n_jobs=2,
              buffer_size=buffer_size,
              out_type="mask",
          )
          assert_array_equal(cluster_p_values, cluster_p_values_buff)
  
      def stat_fun(X, Y):
          return stats.f_oneway(X, Y)[0]
  
      with pytest.warns(RuntimeWarning, match="is only valid"):
          permutation_cluster_test(
              [condition1, condition2],
              n_permutations=1,
              stat_fun=stat_fun,
              out_type="mask",
          )
  
imports: import os
  from functools import partial
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy import linalg, sparse, stats
  from mne import MixedSourceEstimate, SourceEstimate, SourceSpaces, VolSourceEstimate
  from mne.stats import combine_adjacency, ttest_ind_no_p
  from mne.stats.cluster_level import f_oneway, permutation_cluster_1samp_test, permutation_cluster_test, spatio_temporal_cluster_1samp_test, spatio_temporal_cluster_test, summarize_clusters_stc, ttest_1samp_no_p
  from mne.utils import _record_warnings, catch_logging
label_desc: Use image node_id 6 for calling a global function with example usage: test_cluster_permutation_test(numba_conditional) and returns: stats