code: def test_bca(bs_setup):
      num_bootstrap = 20
      bs = IIDBootstrap(bs_setup.x, seed=23456)
  
      ci_direct = bs.conf_int(
          bs_setup.func, reps=num_bootstrap, method="bca"
      )
      bs.reset()
      base, results = bs._base, bs._results
      p = np.zeros(2)
      p[0] = np.mean(results[:, 0] < base[0])
      p[1] = np.mean(results[:, 1] < base[1])
      b = stats.norm.ppf(p)
      b = b[:, None]
      q = stats.norm.ppf(np.array([0.025, 0.975]))
  
      bs_setup.func(bs_setup.x)
      nobs = bs_setup.x.shape[0]
      jk = _loo_jackknife(bs_setup.func, nobs, [bs_setup.x], {})
      u = jk.mean() - jk
      u2 = np.sum(u * u, 0)
      u3 = np.sum(u * u * u, 0)
      a = u3 / (6.0 * (u2**1.5))
      a = a[:, None]
      percentiles = 100 * stats.norm.cdf(
          b + (b + q) / (1 - a * (b + q))
      )
  
      ci = np.zeros((2, 2))
      for i in range(2):
          ci[i] = np.percentile(results[:, i], list(percentiles[i]))
      ci = ci.T
      assert_allclose(ci_direct, ci)
  
      bs = IIDBootstrap(y=bs_setup.x, seed=23456)
      ci_kwarg = bs.conf_int(
          bs_setup.func, reps=num_bootstrap, method="bca"
      )
      assert_allclose(ci_kwarg, ci)
  
      bs = IIDBootstrap(y=bs_setup.x_df, seed=23456)
      ci_kwarg_pandas = bs.conf_int(
          bs_setup.func, reps=num_bootstrap, method="bca"
      )
      assert_allclose(ci_kwarg_pandas, ci)
  
imports: from __future__ import annotations
  import copy
  from typing import Callable, NamedTuple
  import warnings
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose, assert_equal
  import pandas
  from pandas.testing import assert_frame_equal, assert_series_equal
  import pytest
  import scipy.stats
  from arch.bootstrap import CircularBlockBootstrap, IIDBootstrap, IndependentSamplesBootstrap, MovingBlockBootstrap, StationaryBootstrap
  from arch.bootstrap._samplers_python import stationary_bootstrap_sample
  from arch.bootstrap._samplers_python import stationary_bootstrap_sample_python
  from arch.bootstrap.base import _loo_jackknife
  from arch.utility.exceptions import StudentizationError
label_desc: Use image node_id 18 for calling a global function with example usage: test_bca(bs_setup) without return types