Apply PEP8 whitespace rules and some pylint cleanup