code: def _percentile_along_axis(theta_hat_b, alpha):
      """`np.percentile` with different percentile for each slice."""
      # the difference between _percentile_along_axis and np.percentile is that
      # np.percentile gets _all_ the qs for each axis slice, whereas
      # _percentile_along_axis gets the q corresponding with each axis slice
      shape = theta_hat_b.shape[:-1]
      alpha = np.broadcast_to(alpha, shape)
      percentiles = np.zeros_like(alpha, dtype=np.float64)
      for indices, alpha_i in np.ndenumerate(alpha):
          theta_hat_b_i = theta_hat_b[indices]
          percentiles[indices] = np.percentile(theta_hat_b_i, alpha_i)
      return percentiles[()]
  
file_path: catboost/contrib/python/scipy/py3/scipy/stats/_bootstrap.py
imports: import numpy
  from scipy._lib._util import check_random_state
  from scipy.special import ndtr, ndtri
  from scipy._lib._util import rng_integers
  from dataclasses import make_dataclass
  from ._common import ConfidenceInterval
  from scipy.stats.stats import _broadcast_concatenate
label_desc: Use image node_id 5 for calling a global function with example usage: _percentile_along_axis(theta_hat_b, alpha) and returns: percentiles