DOC: fix headers to avoid warnings
DOC: remove usage of code-block in docstrings (#3430)
Merge pull request #5903 from jorisvandenbossche/docs-code-snippets

DOC: remove usage of code-block directive in docstrings + fix some warnings