def clamp(value: int, low: int, high: int) -> int: if value < low: return low if value > high: return high return value