human
Write me a the Python code you requested given the following:
Complete the below
def _decorate_with_warning(func, wtype, message, docstring_header=None):

    ''''Wrap a function with a warnings.warn and augmented docstring.'
    '''
assistant
#Here is the Python code you requested.
    message = _sanitize_restructured_text(message)
    @decorator
    def warned(fn, *args, **kwargs):
        warnings.warn(message, wtype, stacklevel=3)
        return fn(*args, **kwargs)
    doc = (((func.__doc__ is not None) and func.__doc__) or '')
    if (docstring_header is not None):
        docstring_header %= dict(func=func.__name__)
        doc = inject_docstring_text(doc, docstring_header, 1)
    decorated = warned(func)
    decorated.__doc__ = doc
    return decorated