Python imports
I propose to follow PEP8 in the way we declare and sort python imports. This means, among other things, putting all imports at the beginning of the file and avoid imports inside classes and functions.
There are also recommendations for sorting the imports. There is a tool that does the sorting automatically: https://pypi.org/project/isort/
I have been using isort for other projects and it works very well. It can be used as a pre-commit hook if we find that useful. I use it as an Emacs hook on write (package python-isort on MELPA) and there are plugins for inferior editors also.