code: def test_rate_poisson_consistency(method):
      # check consistency between test and confint for one poisson rate
      count, nobs = 15, 400
      ci = confint_poisson(count, nobs, method=method)
      pv1 = smr.test_poisson(
          count, nobs, value=ci[0], method=method
      ).pvalue
      pv2 = smr.test_poisson(
          count, nobs, value=ci[1], method=method
      ).pvalue
  
      rtol = 1e-10
      if method in ["midp-c"]:
          # numerical root finding, lower precision
          rtol = 1e-6
      assert_allclose(pv1, 0.05, rtol=rtol)
      assert_allclose(pv2, 0.05, rtol=rtol)
  
      # check one-sided, note all confint are central
      pv1 = smr.test_poisson(
          count, nobs, value=ci[0], method=method, alternative="larger"
      ).pvalue
      pv2 = smr.test_poisson(
          count, nobs, value=ci[1], method=method, alternative="smaller"
      ).pvalue
  
      assert_allclose(pv1, 0.025, rtol=rtol)
      assert_allclose(pv2, 0.025, rtol=rtol)
  
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 1 for calling a global function with example usage: test_rate_poisson_consistency(method) without return types