def ensure_range(
    lower: int | float, upper: int | float
) -> t.Callable[[int | float], bool]:
    """Ensure that given value is within the range of [lower, upper]."""

    def v(value: int | float) -> bool:
        return lower <= value <= upper

    return v
Ensure that given value is within the range of [lower, upper].
src/bentoml/_internal/configuration/helpers.py