

def intClamp(v, low, high):
    'Clamps a value to the integer range [low, high] (inclusive).\n\n  Args:\n    v: Number to be clamped.\n    low: Lower bound.\n    high: Upper bound.\n\n  Returns:\n    An integer closest to v in the range [low, high].\n  '
    return max(int(low), min(int(v), int(high)))

dataset/ETHPy150Open GoogleCloudPlatform/appengine-search-python-java/product_search_python/utils.py intClamp/original