def _gt_quantile(x: list[int | float], q: float) -> int | float:
    """
    Calculate the quantile of a list of values.
    """
    x.sort()
    n = len(x)
    return x[int(n * q)]

    Calculate the quantile of a list of values.
    
great_tables/_utils_nanoplots.py