DOC: Fixing more doc warings and wrong .. code-block :: directive (space before colon)
Using `.. code-block ::` with a space before the colon wasn't making the blocks be validated for flake8 issues. Same for `ipython` directive.

Making sure the space is not present, and fixing flake8 errors.