code: def test_permutation_t_test_tail(tail_name, tail_code):
      """Test that tails work properly."""
      X = np.random.randn(18, 1)
  
      t_obs, p_values, _ = permutation_t_test(
          X, n_permutations="all", tail=tail_code
      )
      t_obs_scipy, p_values_scipy = stats.ttest_1samp(
          X[:, 0], 0, alternative=tail_name
      )
      assert_allclose(t_obs[0], t_obs_scipy, 8)
      assert_allclose(p_values[0], p_values_scipy, rtol=1e-2)
  
file_path: mne-python/mne/stats/tests/test_permutations.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from scipy import sparse, stats
  from mne.stats import permutation_cluster_1samp_test
  from mne.stats.permutations import _ci, bootstrap_confidence_interval, permutation_t_test
label_desc: Use image node_id 2 for calling a global function with example usage: test_permutation_t_test_tail(tail_name, tail_code) without return types