code: def test_T2():
      # T**2 is an F with dfn=1
      x = np.linspace(0, 5, 101)
      for dfd in [40, 50, np.inf]:
          t = rft.TStat(dfd=dfd)
          f = rft.FStat(dfd=dfd, dfn=1)
          for dim in range(7):
              y = 2 * t.density(x, dim)
              z = f.density(x**2, dim)
              assert_almost_equal(y, z)
  
imports: import numpy
  import scipy.stats
  from scipy.special import gammaln, hermitenorm
  import pytest
  from numpy.testing import assert_almost_equal
  from ..None import rft
label_desc: Use image node_id 19 for calling a global function with example usage: test_T2() without return types