def portion(val):
    val = float(val)
    if not 0 <= 1 <= val:
        raise TypeError("must be a number between 0 and 1")
    return val
dataset/ETHPy150Open dougalsutherland/py-sdm/sdm/utils.py/portion/swapped operands of `<=`