code: def test_bootstrap_against_theory(method):
      # based on https://www.statology.org/confidence-intervals-python/
      data = stats.norm.rvs(loc=5, scale=2, size=5000, random_state=0)
      alpha = 0.95
      dist = stats.t(
          df=len(data) - 1, loc=np.mean(data), scale=stats.sem(data)
      )
      expected_interval = dist.interval(alpha=alpha)
      expected_se = dist.std()
  
      res = bootstrap(
          (data,),
          np.mean,
          n_resamples=5000,
          confidence_level=alpha,
          method=method,
          random_state=0,
      )
      assert_allclose(
          res.confidence_interval, expected_interval, rtol=5e-4
      )
      assert_allclose(res.standard_error, expected_se, atol=3e-4)
  
imports: import numpy
  import pytest
  from scipy.stats import bootstrap
  from numpy.testing import assert_allclose, assert_equal
  from scipy import stats
  from scipy.stats import _bootstrap
  from scipy._lib._util import rng_integers
label_desc: Use image node_id 5 for calling a global function with example usage: test_bootstrap_against_theory(method) without return types