code: def test_one_sided_versus_two_test(rng):
      """Check that a positive effect is always better \
      recovered with one-sided."""
      n_descriptors = 100
      n_regressors = 1
      target_var = rng.standard_normal((N_SAMPLES, n_descriptors))
      tested_var = rng.standard_normal((N_SAMPLES, n_regressors))
  
      # one-sided
      output_1_sided = permuted_ols(
          tested_var,
          target_var,
          model_intercept=False,
          two_sided_test=False,
          n_perm=N_PERM,
          random_state=0,
          output_type="dict",
      )
      assert output_1_sided["logp_max_t"].shape == (
          n_regressors,
          n_descriptors,
      )
  
      # two-sided
      output_2_sided = permuted_ols(
          tested_var,
          target_var,
          model_intercept=False,
          two_sided_test=True,
          n_perm=N_PERM,
          random_state=0,
          output_type="dict",
      )
      assert output_2_sided["logp_max_t"].shape == (
          n_regressors,
          n_descriptors,
      )
  
      positive_effect_location = output_1_sided["logp_max_t"] > 1
      assert_equal(
          np.sum(
              output_2_sided["logp_max_t"][positive_effect_location]
              - output_1_sided["logp_max_t"][positive_effect_location]
              > 0
          ),
          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 32 for calling a global function with example usage: test_one_sided_versus_two_test(rng) without return types