def METHOD_NAME(sort, primes):
    intervals = librosa.plimit_intervals(primes=primes, bins_per_octave=20, sort=sort, return_factors=False)
    factors = librosa.plimit_intervals(primes=primes, bins_per_octave=20, sort=sort, return_factors=True)
    assert len(intervals) == len(factors)
    for ival, facts in zip(intervals, factors):
        value = 0.
        for prime in facts:
            value += facts[prime] * np.log2(prime)
        assert np.isclose(ival, np.power(2, value))