def constrain(value, lowest, highest):
    return min(highest, max(value, lowest))
Test whether `value` is within the range `(highest, lowest)`.
dataset/ETHPy150Open lsaffre/lino/lino/utils/ranges.py/constrain