import functools


def pass_through_none(fn):
    """Modify a unary function so when its input is None, it returns None."""

    @functools.wraps(fn)
    def new_fn(arg):
        if arg is None:
            return None
        return fn(arg)

    return new_fn