def get_next_power_2(n):
    """
        Returns the closest number that is smaller than n that is a power of 2.
    """

    power = 1
    while (power < n):
        power *= 2
    if power > 1:
        return power / 2
    else:
        return 1
dataset/ETHPy150Open Agerrr/Automated_Music_Transcription/least_squares_first_peaks_2.py/get_next_power_2/original