some code quality cleanup.

do to some report of static analysis tool, unused variable (mainly that)
a few function re-declarations, a python2 print statement...

cf https://www.codacy.com/public/bussonniermatthias/ipython/issues
I don't even get how this worked, I would have though python would raise a SyntaxError on parsing. 
Maybe @takluyver knows.