DOC: python 3 compatibility in code examples
Some changes to our code examples needed to make them all run with python 3.

(there are still problems with our accessor extensions to have doc building on py3 fully working)