Format whitespace around parentheses consistently

I noticed while porting this stuff to Python 3 that there was inconsistent formatting of parentheses (`foo (bar)`, `foo(bar)`, and `foo ( bar )`).