Doc styling fixes
# What does this PR do?

This PR fixes a few of the docstrings left in a bad state by #8067 and a small bug in the styling script (it was matching lines of the form `.. note::` or `.. warning::` to kind of examples inside docstrings.

With this, everything should now be fine.