def METHOD_NAME(self, pxx: npt.NDArray, exclude_pi: bool) -> Tuple[float, float]:
    """
    Carry out fishers g test for periodicity.
    Fisher's g test tests the null hypothesis that the time series is gaussian white noise
    against the alternative that there is a deterministic periodic component[1]
    If the length of the time series is even then the intensity at pi should be excluded
    If the length of the power spectral density estimate is larger than 700 then an approximate
    p value is calculated otherwise the exact p value is calculate.
    This implementation was taken from the R package GeneCycle[2]
    Parameters
    ----------
    pxx: ArrayLike
        Estimate of the power spectral density
    exclude_pi: bool
        A bool to indicate whether the frequnecy located at pi should be removed.
    Returns
    -------
    Tuple[float, float]
        G test test statistic
        G test P value
    References
    ----------
    [1] M. Ahdesmaki, H. Lahdesmaki and O. Yli-Harja, "Robust Fisher's Test for Periodicity
    Detection in Noisy Biological Time Series," 2007 IEEE International Workshop on Genomic
    Signal Processing and Statistics, 2007, pp. 1-4, doi: 10.1109/GENSIPS.2007.4365817.
    [2] https://github.com/cran/GeneCycle/blob/master/R/fisher.g.test.R
    """
    if exclude_pi:
        pxx = pxx[:-1]
    pxx_length = len(pxx)
    test_statistic = np.max(pxx) / sum(pxx)
    upper = np.floor(1 / test_statistic).astype("int")
    if pxx_length > 700:
        p_value = 1 - (1 - np.exp(-pxx_length * test_statistic)) ** pxx_length
    else:
        compose = []
        for j in range(1, upper):
            compose.append(
                (-1) ** (j - 1)
                * np.exp(
                    np.log(special.binom(pxx_length, j))
                    + (pxx_length - 1) * np.log(1 - j * test_statistic)
                )
            )
        p_value = sum(compose)
    p_value = min(p_value, 1)
    return test_statistic, p_value