code: def test_jackknife(bs_setup):
      x = bs_setup.x
      results = _loo_jackknife(bs_setup.func, len(x), (x,), {})
  
      direct_results = np.zeros_like(x)
      for i in range(len(x)):
          if i == 0:
              y = x[1:]
          elif i == (len(x) - 1):
              y = x[:-1]
          else:
              temp = list(x[:i])
              temp.extend(list(x[i + 1 :]))
              y = np.array(temp)
          direct_results[i] = bs_setup.func(y)
      assert_allclose(direct_results, results)
  
      x = bs_setup.x_df
      results_df = _loo_jackknife(bs_setup.func, len(x), (x,), {})
      assert_equal(results, results_df)
  
      y = bs_setup.y
      results = _loo_jackknife(bs_setup.func, len(y), (y,), {})
  
      direct_results = np.zeros_like(y)
      for i in range(len(y)):
          if i == 0:
              z = y[1:]
          elif i == (len(y) - 1):
              z = y[:-1]
          else:
              temp = list(y[:i])
              temp.extend(list(y[i + 1 :]))
              z = np.array(temp)
          direct_results[i] = bs_setup.func(z)
      assert_allclose(direct_results, results)
  
      y = bs_setup.y_series
      results_series = _loo_jackknife(bs_setup.func, len(y), (y,), {})
      assert_allclose(results, results_series)
  
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 17 for calling a global function with example usage: test_jackknife(bs_setup) without return types