code: def test_two_sided_recover_positive_and_negative_effects():
      """Check that two-sided can actually recover \
      positive and negative effects."""
      target_var1 = np.arange(0, 10).reshape((-1, 1))  # positive effect
      target_var = np.hstack((target_var1, -target_var1))
      tested_var = np.arange(0, 20, 2)
  
      # one-sided
      output_1_sided_1 = permuted_ols(
          tested_var,
          target_var,
          model_intercept=False,
          two_sided_test=False,
          n_perm=N_PERM,
          random_state=0,
          output_type="dict",
      )
      output_1_sided_1["logp_max_t"]
  
      # one-sided (other side)
      output_1_sided_2 = permuted_ols(
          tested_var,
          -target_var,
          model_intercept=False,
          two_sided_test=False,
          n_perm=N_PERM,
          random_state=0,
          output_type="dict",
      )
  
      # 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",
      )
      output_2_sided["logp_max_t"]
  
      assert_array_almost_equal(
          output_1_sided_1["logp_max_t"][0],
          output_1_sided_2["logp_max_t"][0][::-1],
      )
      assert_array_almost_equal(
          output_1_sided_1["logp_max_t"]
          + output_1_sided_2["logp_max_t"],
          output_2_sided["logp_max_t"],
      )
  
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 33 for calling a global function with example usage: test_two_sided_recover_positive_and_negative_effects() without return types