code: def test_search2():
      # Test that the search region works.
      search = rft.IntrinsicVolumes([3, 4, 5])
      x = np.linspace(0.1, 10, 100)
      stats = [rft.Gaussian(search=search)]
      ostats = [rft.Gaussian()]
      for dfn in range(5, 10):
          for dfd in [40, 50, np.inf]:
              stats.append(rft.FStat(dfn=dfn, dfd=dfd, search=search))
              ostats.append(rft.FStat(dfn=dfn, dfd=dfd))
              stats.append(rft.TStat(dfd=dfd, search=search))
              ostats.append(rft.TStat(dfd=dfd))
          stats.append(rft.ChiSquared(dfn=dfn, search=search))
          ostats.append(rft.ChiSquared(dfn=dfn))
      for i in range(len(stats)):
          stat = stats[i]
          ostat = ostats[i]
          v1 = stat(x)
          v2 = 0
          for j in range(search.mu.shape[0]):
              v2 += ostat.density(x, j) * search.mu[j]
          assert_almost_equal(v1, v2)
  
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 15 for calling a global function with example usage: test_search2() without return types