def METHOD_NAME(
    t,
    y,
    dy=None,
    frequency=None,
    method="auto",
    assume_regular_frequency=False,
    normalization="standard",
    fit_mean=True,
    center_data=True,
    method_kwds=None,
    nterms=1,
):
    """
    Compute the Lomb-scargle Periodogram with a given method.
    Parameters
    ----------
    t : array-like
        sequence of observation times
    y : array-like
        sequence of observations associated with times t
    dy : float or array-like, optional
        error or sequence of observational errors associated with times t
    frequency : array-like
        frequencies (not angular frequencies) at which to evaluate the
        periodogram. If not specified, optimal frequencies will be chosen using
        a heuristic which will attempt to provide sufficient frequency range
        and sampling so that peaks will not be missed. Note that in order to
        use method='fast', frequencies must be regularly spaced.
    method : str, optional
        specify the lomb scargle implementation to use. Options are:
        - 'auto': choose the best method based on the input
        - 'fast': use the O[N log N] fast method. Note that this requires
          evenly-spaced frequencies: by default this will be checked unless
          ``assume_regular_frequency`` is set to True.
        - `slow`: use the O[N^2] pure-python implementation
        - `chi2`: use the O[N^2] chi2/linear-fitting implementation
        - `fastchi2`: use the O[N log N] chi2 implementation. Note that this
          requires evenly-spaced frequencies: by default this will be checked
          unless `assume_regular_frequency` is set to True.
        - `scipy`: use ``scipy.signal.lombscargle``, which is an O[N^2]
          implementation written in C. Note that this does not support
          heteroskedastic errors.
    assume_regular_frequency : bool, optional
        if True, assume that the input frequency is of the form
        freq = f0 + df * np.arange(N). Only referenced if method is 'auto'
        or 'fast'.
    normalization : str, optional
        Normalization to use for the periodogram.
        Options are 'standard' or 'psd'.
    fit_mean : bool, optional
        if True, include a constant offset as part of the model at each
        frequency. This can lead to more accurate results, especially in the
        case of incomplete phase coverage.
    center_data : bool, optional
        if True, pre-center the data by subtracting the weighted mean
        of the input data. This is especially important if `fit_mean = False`
    method_kwds : dict, optional
        additional keywords to pass to the lomb-scargle method
    nterms : int, optional
        number of Fourier terms to use in the periodogram.
        Not supported with every method.
    Returns
    -------
    PLS : array-like
        Lomb-Scargle power associated with each frequency omega
    """
    # frequencies should be one-dimensional arrays
    output_shape = frequency.shape
    frequency = frequency.ravel()
    # we'll need to adjust args and kwds for each method
    args = (t, y, dy)
    kwds = dict(
        frequency=frequency,
        center_data=center_data,
        fit_mean=fit_mean,
        normalization=normalization,
        nterms=nterms,
        **(method_kwds or {}),
    )
    method = validate_method(
        method,
        dy=dy,
        fit_mean=fit_mean,
        nterms=nterms,
        frequency=frequency,
        assume_regular_frequency=assume_regular_frequency,
    )
    # scipy doesn't support dy or fit_mean=True
    if method == "scipy":
        if kwds.pop("fit_mean"):
            raise ValueError("scipy method does not support fit_mean=True")
        if dy is not None:
            dy = np.ravel(np.asarray(dy))
            if not np.allclose(dy[0], dy):
                raise ValueError("scipy method only supports uniform uncertainties dy")
        args = (t, y)
    # fast methods require frequency expressed as a grid
    if method.startswith("fast"):
        f0, df, Nf = _get_frequency_grid(
            kwds.pop("frequency"), assume_regular_frequency
        )
        kwds.update(f0=f0, df=df, Nf=Nf)
    # only chi2 methods support nterms
    if not method.endswith("chi2"):
        if kwds.pop("nterms") != 1:
            raise ValueError(
                "nterms != 1 only supported with 'chi2' or 'fastchi2' methods"
            )
    PLS = METHODS[method](*args, **kwds)
    return PLS.reshape(output_shape)