def try_or_none(f):
    """wraps f to return None if f raises an exception
    assumes f takes only one input"""
    def f_or_none(x):
        try:
            return f(x)
        except:
            return None
    return f_or_none