Minor PEP8 nitpick: you have have spaces after ``,``. You could run flake8 on this file, but as I don't think it is pep8 compliant at all, you'll have a lot of warnings that are not on lines of code you changed.