Regarding your imports above. It's good practice in python to list imports in the following order:

python-libs

3rdparty-libs (if multiple 3rd parties, it's good practice to group similar ones together)

your-project-libs

Leaving a blank line between the categories, and ordering imports alphabetically.