code: def test_permuted_ols_check_h0_noeffect_signswap():
      """Check that h0 is close to the theoretical distribution \
      for permuted OLS with sign swap.
  
      Theoretical distribution is known for this simple design \
          (= t(n_samples - dof)).
      """
      # create dummy design with no effect
      rng = np.random.RandomState(0)
      target_var = rng.randn(N_SAMPLES, 1)
  
      n_regressors = 1
      tested_var = np.ones((N_SAMPLES, n_regressors))
  
      all_kstest_pvals, all_mse = run_permutations(
          tested_var, target_var, model_intercept=False
      )
  
      all_kstest_pvals = np.array(all_kstest_pvals).reshape(
          (len(PERM_RANGES), -1)
      )
      all_mse = np.array(all_mse).reshape((len(PERM_RANGES), -1))
  
      # check that a difference between distributions is not rejected by KS test
      assert_array_less(
          0.01 / (len(PERM_RANGES) * 10.0), all_kstest_pvals
      )
      # consistency of the algorithm: the more permutations, the less the MSE
      assert_array_less(np.diff(all_mse.mean(1)), 0)
  
imports: import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_less, assert_equal
  from scipy import stats
  from nilearn.conftest import _rng
  from nilearn.maskers import NiftiMasker
  from nilearn.mass_univariate import permuted_ols
label_desc: Use image node_id 18 for calling a global function with example usage: test_permuted_ols_check_h0_noeffect_signswap() without return types