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