def non_none(*args, raise_if_all_none=None):
    """
    Return the first arg that is not none; optionally raise specified exception if all none
    """
    for a in args:
        if a is not None:
            return a
    if raise_if_all_none is not None:
        raise raise_if_all_none
    return None