DOC: Fix format of advanced.rst
Our documentation should follow the PEP-8 standard, but for historical reasons there are many formats that don't. We should fix them now.

This issue is to fix the format of `doc/source/advanced.rst`. To find the errors, first is required to install a newer version of `flake8-rst`:
```
conda install -c conda-forge flake8-rst=0.5.0
```

Then, all the errors can be obtained with:
```
$ flake8-rst doc/source/advanced.rst 
doc/source/advanced.rst:608:23: E231 missing whitespace after ','
doc/source/advanced.rst:784:15: E902 TokenError: EOF in multi-line statement
doc/source/advanced.rst:787:20: E999 SyntaxError: invalid syntax
doc/source/advanced.rst:12:31: E225 missing whitespace around operator
doc/source/advanced.rst:191:13: E231 missing whitespace after ','
doc/source/advanced.rst:194:13: E231 missing whitespace after ','
doc/source/advanced.rst:203:13: E231 missing whitespace after ','
doc/source/advanced.rst:238:25: E231 missing whitespace after ','
doc/source/advanced.rst:331:20: E231 missing whitespace after ','
doc/source/advanced.rst:332:32: E231 missing whitespace after ','
doc/source/advanced.rst:332:35: E272 multiple spaces before keyword
doc/source/advanced.rst:334:51: E231 missing whitespace after ','
doc/source/advanced.rst:335:51: E231 missing whitespace after ','
doc/source/advanced.rst:336:51: E231 missing whitespace after ','
doc/source/advanced.rst:337:51: E231 missing whitespace after ','
doc/source/advanced.rst:338:47: E231 missing whitespace after ','
doc/source/advanced.rst:338:54: E231 missing whitespace after ','
doc/source/advanced.rst:338:59: E231 missing whitespace after ','
doc/source/advanced.rst:339:47: E231 missing whitespace after ','
doc/source/advanced.rst:339:54: E231 missing whitespace after ','
doc/source/advanced.rst:339:59: E231 missing whitespace after ','
doc/source/advanced.rst:341:46: E226 missing whitespace around arithmetic operator
doc/source/advanced.rst:341:83: E501 line too long (98 > 79 characters)
doc/source/advanced.rst:341:84: E231 missing whitespace after ','
doc/source/advanced.rst:350:24: E231 missing whitespace after ','
doc/source/advanced.rst:415:23: E231 missing whitespace after ','
doc/source/advanced.rst:415:30: E231 missing whitespace after ','
doc/source/advanced.rst:428:12: E231 missing whitespace after ','
doc/source/advanced.rst:428:25: E231 missing whitespace after ','
doc/source/advanced.rst:439:12: E231 missing whitespace after ','
doc/source/advanced.rst:439:19: E231 missing whitespace after ','
doc/source/advanced.rst:470:54: E231 missing whitespace after ','
doc/source/advanced.rst:471:35: E231 missing whitespace after ','
doc/source/advanced.rst:471:37: E231 missing whitespace after ','
doc/source/advanced.rst:471:39: E231 missing whitespace after ','
doc/source/advanced.rst:471:42: E231 missing whitespace after ','
doc/source/advanced.rst:471:45: E231 missing whitespace after ','
doc/source/advanced.rst:471:47: E231 missing whitespace after ','
doc/source/advanced.rst:471:49: E231 missing whitespace after ','
doc/source/advanced.rst:472:39: E231 missing whitespace after ','
doc/source/advanced.rst:504:28: E231 missing whitespace after ','
doc/source/advanced.rst:525:26: E203 whitespace before ':'
doc/source/advanced.rst:525:39: E203 whitespace before ':'
doc/source/advanced.rst:555:4: E402 module level import not at top of file
doc/source/advanced.rst:555:17: E702 multiple statements on one line (semicolon)
doc/source/advanced.rst:630:14: E231 missing whitespace after ','
doc/source/advanced.rst:691:13: E999 SyntaxError: invalid syntax
doc/source/advanced.rst:720:4: E402 module level import not at top of file
doc/source/advanced.rst:886:52: E231 missing whitespace after ','
doc/source/advanced.rst:889:52: E231 missing whitespace after ','
doc/source/advanced.rst:890:52: E231 missing whitespace after ','
doc/source/advanced.rst:899:19: E231 missing whitespace after ','
doc/source/advanced.rst:937:23: E127 continuation line over-indented for visual indent
doc/source/advanced.rst:1017:83: E501 line too long (84 > 79 characters)
doc/source/advanced.rst:1054:31: E231 missing whitespace after ','
doc/source/advanced.rst:1054:33: E231 missing whitespace after ','
doc/source/advanced.rst:1054:35: E231 missing whitespace after ','
doc/source/advanced.rst:1054:37: E231 missing whitespace after ','
doc/source/advanced.rst:1068:31: E231 missing whitespace after ','
doc/source/advanced.rst:1068:33: E231 missing whitespace after ','
doc/source/advanced.rst:1068:35: E231 missing whitespace after ','
doc/source/advanced.rst:1068:37: E231 missing whitespace after ','
doc/source/advanced.rst:1068:39: E231 missing whitespace after ','
```

After fixing this issue, the previous command should not report any error.