code: def test_permuted_ols_no_covar_warning(rng):
      """Ensure that a warning is raised when a given voxel has all zeros."""
      target_var, tested_var, *_ = _create_design(
          rng, n_samples=N_SAMPLES, n_descriptors=10, n_regressors=1
      )
      output_1 = permuted_ols(
          tested_var,
          target_var,
          model_intercept=False,
          n_perm=N_PERM,
          random_state=0,
          output_type="dict",
      )
  
      # test with ravelized tested_var
      target_var[:, 0] = 0
  
      with pytest.warns(UserWarning):
          output_2 = permuted_ols(
              np.ravel(tested_var),
              target_var,
              model_intercept=False,
              n_perm=N_PERM,
              random_state=0,
              output_type="dict",
          )
  
      assert np.array_equal(output_1["t"][1:], output_2["t"][1:])
  
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 22 for calling a global function with example usage: test_permuted_ols_no_covar_warning(rng) without return types