code: def bootstrap_two_point(
      data,
      bins,
      Nbootstrap=10,
      method="standard",
      return_bootstraps=False,
      random_state=None,
  ):
      """Bootstrapped two-point correlation function
  
      Parameters
      ----------
      data : array_like
          input data, shape = [n_samples, n_features]
      bins : array_like
          bins within which to compute the 2-point correlation.
          shape = Nbins + 1
      Nbootstrap : integer
          number of bootstrap resamples to perform (default = 10)
      method : string
          "standard" or "landy-szalay".
      return_bootstraps: bool
          if True, return full bootstrapped samples
      random_state : integer, np.random.RandomState, or None
          specify the random state to use for generating background
  
      Returns
      -------
      corr, corr_err : ndarrays
          the estimate of the correlation function and the bootstrap
          error within each bin. shape = Nbins
      """
      data = np.asarray(data)
      bins = np.asarray(bins)
      rng = check_random_state(random_state)
  
      if method not in ["standard", "landy-szalay"]:
          raise ValueError(
              "method must be 'standard' or 'landy-szalay'"
          )
  
      if bins.ndim != 1:
          raise ValueError("bins must be a 1D array")
  
      if data.ndim == 1:
          data = data[:, np.newaxis]
      elif data.ndim != 2:
          raise ValueError("data should be 1D or 2D")
  
      if Nbootstrap < 2:
          raise ValueError("Nbootstrap must be greater than 1")
  
      n_samples, n_features = data.shape
  
      # get the baseline estimate
      corr = two_point(data, bins, method=method, random_state=rng)
  
      bootstraps = np.zeros((Nbootstrap, len(corr)))
  
      for i in range(Nbootstrap):
          indices = rng.randint(0, n_samples, n_samples)
          bootstraps[i] = two_point(
              data[indices, :], bins, method=method, random_state=rng
          )
  
      # use masked std dev in case of NaNs
      corr_err = np.asarray(
          np.ma.masked_invalid(bootstraps).std(0, ddof=1)
      )
  
      if return_bootstraps:
          return corr, corr_err, bootstraps
      else:
          return corr, corr_err
  
file_path: astroML/astroML/correlation.py
imports: import numpy
  from sklearn.neighbors import KDTree
  from sklearn.utils import check_random_state
label_desc: Use image node_id 5 for calling a global function with example usage: bootstrap_two_point(data, bins, Nbootstrap, method, return_bootstraps, random_state) and returns: corr,  corr_err,  bootstraps, corr,  corr_err