def wrap_if_constant(func):
    """If passed a constant, wrap it in a function. If passed a function, just
    return it as is"""
    if hasattr(func, '__call__'):
        return func
    else:
        return lambda x: func
