code: def lomb_scargle_bootstrap(
      t,
      y,
      dy,
      omega,
      generalized=True,
      subtract_mean=True,
      N_bootstraps=100,
      random_state=None,
  ):
      """Use a bootstrap analysis to compute Lomb-Scargle significance
  
      Parameters
      ----------
      The first set of parameters are passed to the lomb_scargle algorithm
  
      t : array_like
          sequence of times
      y : array_like
          sequence of observations
      dy : array_like
          sequence of observational errors
      omega : array_like
          frequencies at which to evaluate p(omega)
      generalized : bool
          if True (default) use generalized lomb-scargle method
          otherwise, use classic lomb-scargle.
      subtract_mean : bool
          if True (default) subtract the sample mean from the data before
          computing the periodogram.  Only referenced if generalized is False
  
      Remaining parameters control the bootstrap
  
      N_bootstraps : int
          number of bootstraps
      random_state : None, int, or RandomState object
          random seed, or random number generator
  
      Returns
      -------
      D : ndarray
          distribution of the height of the highest peak
      """
      random_state = check_random_state(random_state)
      t = np.asarray(t)
      y = np.asarray(y)
      dy = np.asarray(dy) + np.zeros_like(y)
  
      D = np.zeros(N_bootstraps)
  
      for i in range(N_bootstraps):
          ind = random_state.randint(0, len(y), len(y))
          p = lomb_scargle(
              t,
              y[ind],
              dy[ind],
              omega,
              generalized=generalized,
              subtract_mean=subtract_mean,
          )
          D[i] = p.max()
  
      return D
  
file_path: astroML/astroML/time_series/periodogram.py
imports: import numpy
  from sklearn.utils import check_random_state
  from ..utils.decorators import deprecated
  from ..utils.exceptions import AstroMLDeprecationWarning
label_desc: Use image node_id 2 for calling a global function with example usage: lomb_scargle_bootstrap(t, y, dy, omega, generalized, subtract_mean, N_bootstraps, random_state) and returns: D