def METHOD_NAME(counts: np.ndarray, *, percentage: int):
    """
    D50/DXX according to https://patents.google.com/patent/WO2012097374A1/en
    Parameters
    ----------
    percentage
        Percentage of J
    """
    freqs = counts / np.sum(counts)
    np.testing.assert_almost_equal(np.sum(freqs), 1)
    freqs = np.sort(freqs)[::-1]
    prop, i = 0, 0
    while prop < (percentage / 100):
        prop += freqs[i]
        i += 1
    return i / len(freqs) * 100