The Python code is improved here in the following ways:
Avoid very long lines (Python code is usually limited to 79 columns, made it 99 here)
Remove unused variables and imports
Use 4 spaces consistently for indentation (in some cases tabs and others were used)
Remove commented code (which can be found in git history, and add noise to the working code)
General PEP-8 isses (such as spaces around operators...)
Most changes have been automatically applied using black. All changes are arbitrary on the styles, no changes to the execution of the library are added here.
The Python code is improved here in the following ways:
Most changes have been automatically applied using black. All changes are arbitrary on the styles, no changes to the execution of the library are added here.