code: def test_permuted_ols_intercept_nocovar(rng):
      n_descriptors = 10
      n_regressors = 1
      tested_var = np.ones((N_SAMPLES, n_regressors))
      target_var = rng.standard_normal((N_SAMPLES, n_descriptors))
  
      output = permuted_ols(
          tested_var,
          target_var,
          confounding_vars=None,
          n_perm=N_PERM,
          random_state=0,
          output_type="dict",
      )
  
      ref_score = compare_to_ref_score(
          output["t"], tested_var, target_var
      )
      assert ref_score.shape == (n_regressors, n_descriptors)
      assert output["logp_max_t"].shape == (n_regressors, n_descriptors)
      assert output["t"].shape == (n_regressors, n_descriptors)
      assert_array_less(
          output["logp_max_t"], 1.0
      )  # ensure sign swap is correctly done
  
      # same thing but with model_intercept=True to check it has no effect
      output_addintercept = permuted_ols(
          tested_var,
          target_var,
          confounding_vars=None,
          model_intercept=False,
          n_perm=0,
          random_state=0,
          output_type="dict",
      )
      compare_to_ref_score(
          output_addintercept["t"], tested_var, target_var
      )
      assert output_addintercept["t"].shape == (
          n_regressors,
          n_descriptors,
      )
  
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 30 for calling a global function with example usage: test_permuted_ols_intercept_nocovar(rng) without return types