code: def test_vectorize_statistic(axis):
      # test that _vectorize_statistic vectorizes a statistic along `axis`
  
      def statistic(*data, axis):
          # an arbitrary, vectorized statistic
          return sum((sample.mean(axis) for sample in data))
  
      def statistic_1d(*data):
          # the same statistic, not vectorized
          for sample in data:
              assert sample.ndim == 1
          return statistic(*data, axis=0)
  
      # vectorize the non-vectorized statistic
      statistic2 = _bootstrap._vectorize_statistic(statistic_1d)
  
      np.random.seed(0)
      x = np.random.rand(4, 5, 6)
      y = np.random.rand(4, 1, 6)
      z = np.random.rand(1, 5, 6)
  
      res1 = statistic(x, y, z, axis=axis)
      res2 = statistic2(x, y, z, axis=axis)
      assert_allclose(res1, res2)
  
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 15 for calling a global function with example usage: test_vectorize_statistic(axis) and returns: sum, statistic