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

    """Decorator to raise warning each time the function is called.
    Args:
    warning: The warning message to be displayed as a string (optinoal).
    """
    warning = (warning or '')
    def mark_deprecated(f):
        def deprecated_function(*args, **kwargs):
            warnings.warn(warning, DeprecationWarning, stacklevel=2)
            return f(*args, **kwargs)
        try:
            deprecated_function.func_name = f.func_name
        except TypeError:
            pass
        return deprecated_function
    return mark_deprecated