code: def bootstrap(x, statistic=bs_se, B=1000, alpha=0.95):
      """
  
      Bootstrap resampling [1]_ to accurately estimate the standard error and
      confidence interval of a desired statistic of a probability distribution
      function (pdf).
  
      Parameters
      ----------
      x : ndarray (N, 1)
          Observable sample to resample. N should be reasonably large.
      statistic : method (optional)
          Method to calculate the desired statistic. (Default: calculate
          bootstrap standard error)
      B : integer (optional)
          Total number of bootstrap resamples in bootstrap pdf. (Default: 1000)
      alpha : float (optional)
          Percentile for confidence interval of the statistic. (Default: 0.05)
  
      Returns
      -------
      bs_pdf : ndarray (M, 1)
          Jackknife probability distribution function of the statistic.
      se : float
          Standard error of the statistic.
      ci : ndarray (2, 1)
          Confidence interval of the statistic.
  
      See Also
      --------
      numpy.std, numpy.random.random
  
      Notes
      -----
      Bootstrap resampling is non parametric. It is quite powerful in
      determining the standard error and the confidence interval of a sample
      distribution. The key characteristics of bootstrap is:
  
      1) uniform weighting among all samples (1/n)
      2) resampling with replacement
  
      In general, the sample size should be large to ensure accuracy of the
      estimates. The number of bootstrap resamples should be large as well as
      that will also influence the accuracy of the estimate.
  
      References
      ----------
      ..  [1] Efron, B., 1979. 1977 Rietz lecture--Bootstrap methods--Another
          look at the jackknife. Ann. Stat. 7, 1-26.
  
      """
      N = len(x)
      bs_pdf = np.empty((B,))
  
      rng = np.random.default_rng()
  
      for ii in range(0, B):
          # resample with replacement
          rand_index = np.int16(np.round(rng.random(N) * (N - 1)))
          bs_pdf[ii] = statistic(x[rand_index])
  
      return bs_pdf, bs_se(bs_pdf), abc(x, statistic, alpha=alpha)
  
file_path: dipy/dipy/boots/resampling.py
imports: import numpy
  import scipy
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: bootstrap(x, statistic, B, alpha) and returns: bs_pdf,  bs_se,  abc