def deprecate(message):
    """
        Decorate a function to emit a deprecation warning with the given
        message.
    """
    @decorator
    def decorate(fn, *args, **kw):
        warnings.warn(message, DeprecationWarning, 2)
        return fn(*args, **kw)
    return decorate
Decorate a function to emit a deprecation warning with the given
        message.