code: def test_tol_int(case):
      # results values are from R package `tolerance, e.g.
      # poistol.int(15, 1, m = 1, alpha = 0.05, P = 0.975, side = 1, method="LS")
      # poistol.int(150, 100, m = 100, alpha = 0.05, P = 0.95, side = 2,
      #     method="SC")
      # exact-c is method="TAB"
  
      prob = 0.95
      prob_one = 0.975
      meth, count, exposure, exposure_new, r2, rs, rl = case
      ti = tolerance_int_poisson(
          count,
          exposure,
          prob,
          exposure_new=exposure_new,
          method=meth,
          alpha=0.05,
          alternative="two-sided",
      )
      assert_equal(ti, r2)
      ti = tolerance_int_poisson(
          count,
          exposure,
          prob_one,
          exposure_new=exposure_new,
          method=meth,
          alpha=0.05,
          alternative="larger",
      )
      assert_equal(ti, rl)
      ti = tolerance_int_poisson(
          count,
          exposure,
          prob_one,
          exposure_new=exposure_new,
          method=meth,
          alpha=0.05,
          alternative="smaller",
      )
      assert_equal(ti, rs)
  
      # check without parameter uncertainty, confint at alpha=1
      if meth not in ["exact-c"]:
          # confint for "exact-c" does not collapse to point if alpha=1, check
          ti = tolerance_int_poisson(
              count,
              exposure,
              prob,
              exposure_new=exposure_new,
              method=meth,
              alpha=0.99999,
              alternative="two-sided",
          )
          ci = stats.poisson.interval(
              prob, count / exposure * exposure_new
          )
          assert_equal(ti, ci)
  
      # check confint_quantile_poisson,
      # should same as upper tol_int
      ciq = confint_quantile_poisson(
          count,
          exposure,
          prob_one,
          exposure_new=exposure_new,
          method=meth,
          alpha=0.05,
          alternative="two-sided",
      )
  
      assert_equal(ciq[1], r2[1])
  
      ciq = confint_quantile_poisson(
          count,
          exposure,
          prob_one,
          exposure_new=exposure_new,
          method=meth,
          alpha=0.05,
          alternative="larger",
      )
  
      assert_equal(ciq[1], rl[1])
  
      # should same as lower tol_int
      prob_low = 0.025
      ciq = confint_quantile_poisson(
          count,
          exposure,
          prob_low,
          exposure_new=exposure_new,
          method=meth,
          alpha=0.05,
          alternative="two-sided",
      )
  
      assert_equal(ciq[0], r2[0])
  
      ciq = confint_quantile_poisson(
          count,
          exposure,
          prob_low,
          exposure_new=exposure_new,
          method=meth,
          alpha=0.05,
          alternative="smaller",
      )
  
      assert_equal(ciq[0], rs[0])
  
imports: import pytest
  import warnings
  import numpy
  from numpy import arange
  from numpy.testing import assert_allclose, assert_equal
  from scipy import stats
  import statsmodels.stats.rates
  from statsmodels.stats.rates import confint_poisson, tolerance_int_poisson, confint_quantile_poisson, etest_poisson_2indep, confint_poisson_2indep, nonequivalence_poisson_2indep, power_poisson_ratio_2indep, power_equivalence_poisson_2indep, power_poisson_diff_2indep, power_equivalence_neginb_2indep, power_negbin_ratio_2indep, method_names_poisson_1samp, method_names_poisson_2indep
label_desc: Use image node_id 3 for calling a global function with example usage: test_tol_int(case) without return types