code: def search_frequencies(
      t,
      y,
      dy,
      LS_func=lomb_scargle,
      LS_kwargs=None,
      initial_guess=25,
      limit_fractions=[0.04, 0.3, 0.9, 0.99],
      n_eval=10000,
      n_retry=5,
      n_save=50,
  ):
      """Utility Routine to find the best frequencies
  
      To find the best frequency with a Lomb-Scargle periodogram requires
      searching a large range of frequencies at a very fine resolution.
      This is an iterative routine that searches progressively finer
      grids to narrow-in on the best result.
  
      Parameters
      ----------
      t: array_like
          observed times
      y: array_like
          observed fluxes or magnitudes
      dy: array_like
          observed errors on y
  
      Other Parameters
      ----------------
      LS_func : function
          Function used to perform Lomb-Scargle periodogram.  The call signature
          should be LS_func(t, y, dy, omega, **kwargs)
          (Default is astroML.periodogram.lomb_scargle)
      LS_kwargs : dict
          dictionary of keyword arguments to pass to LS_func in addition to
          (t, y, dy, omega)
      initial_guess : float
          the initial guess of the best period
      limit_fractions : array_like
          the list of fractions to use when zooming in on peak possibilities.
          On the i^th iteration, with f_i = limit_fractions[i], the range
          probed around each candidate will be
          (candidate * f_i, candidate / f_i).
      n_eval : integer or list
          The number of point to evaluate in the range on each iteration.
          If n_eval is a list, it should have the same length as limit_fractions.
      n_retry : integer or list
          Number of top points to search on each iteration. If n_retry is a list,
          it should have the same length as limit_fractions.
      n_save : integer or list
          Number of evaluations to save on each iteration.
          If n_save is a list, it should have the same length as limit_fractions.
  
      Returns
      -------
      omega_top, power_top: ndarrays
          The saved values of omega and power.  These will have size
          1 + n_save * (1 + n_retry * len(limit_fractions))
          as long as n_save > n_retry
      """
      if LS_kwargs is None:
          LS_kwargs = dict()
  
      omega_best = [initial_guess]
      power_best = LS_func(t, y, dy, omega_best, **LS_kwargs)
  
      for Ne, Nr, Ns, frac in np.broadcast(
          n_eval, n_retry, n_save, limit_fractions
      ):
          # make sure we explore differing regions
          log_ob = np.log(omega_best)
          width = 0.1 * np.log(frac)
          log_ob = np.floor(-log_ob / width).astype(int)
          indices = np.arange(len(log_ob))
  
          for i in range(Nr):
              if len(indices) == 0:
                  break
              omega_try = omega_best[indices[-1]]
              non_duplicates = log_ob != log_ob[-1]
              log_ob = log_ob[non_duplicates]
              indices = indices[non_duplicates]
  
              omega = np.linspace(
                  omega_try * frac, omega_try / frac, Ne
              )
              power = LS_func(t, y, dy, omega, **LS_kwargs)
              i = np.argsort(power)[-Ns:]
              power_best = np.concatenate([power_best, power[i]])
              omega_best = np.concatenate([omega_best, omega[i]])
  
          i = np.argsort(power_best)
          power_best = power_best[i]
          omega_best = omega_best[i]
  
      i = np.argsort(omega_best)
      return omega_best[i], power_best[i]
  
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 6 for calling a global function with example usage: search_frequencies(t, y, dy, LS_func, LS_kwargs, initial_guess, limit_fractions, n_eval, n_retry, n_save) and returns: omega_best,  power_best