code: def test_permutation_step_down_p(numba_conditional):
      """Test cluster level permutations with step_down_p."""
      rng = np.random.RandomState(0)
      # subjects, time points, spatial points
      X = rng.randn(9, 2, 10)
      # add some significant points
      X[:, 0:2, 0:2] += 2  # span two time points and two spatial points
      X[
          :, 1, 5:9
      ] += 0.5  # span four time points with 4x smaller amplitude
      thresh = 2
      # make sure it works when we use ALL points in step-down
      t, clusters, p, H0 = permutation_cluster_1samp_test(
          X, threshold=thresh, step_down_p=1.0, out_type="mask"
      )
      # make sure using step-down will actually yield improvements sometimes
      t, clusters, p_old, H0 = permutation_cluster_1samp_test(
          X, threshold=thresh, step_down_p=0.0, out_type="mask"
      )
      assert_equal(np.sum(p_old < 0.05), 1)  # just spatial cluster
      p_min = np.min(p_old)
      assert_allclose(p_min, 0.003906, atol=1e-6)
      t, clusters, p_new, H0 = permutation_cluster_1samp_test(
          X, threshold=thresh, step_down_p=0.05, out_type="mask"
      )
      assert_equal(np.sum(p_new < 0.05), 2)  # time one rescued
      assert np.all(p_old >= p_new)
      p_next = p_new[(p_new > 0.004) & (p_new < 0.05)][0]
      assert_allclose(p_next, 0.015625, atol=1e-6)
  
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 5 for calling a global function with example usage: test_permutation_step_down_p(numba_conditional) without return types