This is stage 2 after converting the code base to follow PEP 8 guidelines. The previous issue was discussed in #717.
In this stage, I ran PyCharm's linter and fixed as many findings as I could, including style issues but also code warnings.
I issued a Pull Request here: #723
There are a lot of changes which might take a while to review, so I went ahead and added comments to explain the reason for most of the changes in order to aid the review process. If anything remains unclear, please let me know and I can clarify.
There may be a few changes that need to be discussed as they could clash with some design choices in the current code base, so if I went too far somewhere, let me know in the PR and we can discuss this.
I tested this version of the tool and everything seems to be in order, although it seems like the CreateML format does not work (it did not work before my refactoring either).