

def min_max(obj, val, is_max):
    ' min/max validator for float and integer\n    '
    n = getattr(obj, ('maximum' if is_max else 'minimum'), None)
    if (n == None):
        return
    _eq = getattr(obj, ('exclusiveMaximum' if is_max else 'exclusiveMinimum'), False)
    if is_max:
        to_raise = ((val >= n) if _eq else (val > to_raise))
    else:
        to_raise = ((val <= n) if _eq else (val < n))
    if to_raise:
        raise ValidationError('condition failed: {0}, v:{1} compared to o:{2}'.format(('maximum' if is_max else 'minimum'), val, n))

dataset/ETHPy150Open mission-liao/pyswagger/pyswagger/primitives/comm.py min_max/VarMisuse@81/125 `n`->`to_raise`