code: def test_tfce_smoke_legacy_warnings():
      target_var, tested_var, masker, *_ = _tfce_design()
  
      # tfce is True, but output_type is "legacy".
      # raise a warning, and get a dictionary.
      with pytest.warns(UserWarning, match="Overriding."):
          out = permuted_ols(
              tested_var,
              target_var,
              model_intercept=False,
              two_sided_test=False,
              n_perm=0,
              random_state=0,
              masker=masker,
              tfce=True,
              output_type="legacy",
          )
  
      assert isinstance(out, dict)
  
      # output_type is "legacy".
      # raise a deprecation warning, but get the standard output.
      with pytest.warns(DeprecationWarning):
          out = permuted_ols(
              tested_var,
              target_var,
              model_intercept=False,
              two_sided_test=False,
              n_perm=N_PERM,
              random_state=0,
              output_type="legacy",
          )
  
      assert isinstance(out, tuple)
  
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 35 for calling a global function with example usage: test_tfce_smoke_legacy_warnings() without return types