def min_or_none(val1, val2):
    return min(val1, val2, key=lambda x: sys.maxint if x is None else x)
Returns min(val1, val2) returning None only if both values are None
dataset/ETHPy150Open scrapinghub/skinfer/skinfer/json_schema_merger.py/min_or_none