from textwrap import dedent


def docstring(**kwargs):
    """
    Replace values in the decorated function docstring.
    """

    def decorator(fn):
        fn.__doc__ = dedent(fn.__doc__).format(name=fn.__name__, module=fn.__module__, **kwargs)
        return fn

    return decorator