human
Complete this python program:
def deprecated(comment=None):
assistant
#Here is the Python program you requested.

    """This is a decorator which can be used to mark functions
    as deprecated. It will result in a warning being emmitted
    when the function is used.
    Examples: ::
    @deprecated
    def oldfunc(): ...
    @deprecated("use newfunc()!")
    def oldfunc2(): ...
    Code from: http://code.activestate.com/recipes/391367/
    """
    def _deprecated(func):
        def newFunc(*args, **kwargs):
            message = ('Call    to    deprecated    function    %s' % func.__name__)
            if comment:
                message += (':    ' + comment)
            warn(message, category=DeprecationWarning, stacklevel=2)
            return func(*args, **kwargs)
        newFunc.__name__ = func.__name__
        newFunc.__doc__ = func.__doc__
        newFunc.__dict__.update(func.__dict__)
        return newFunc
    return _deprecated