Pep8 notes

From raju

Where to put the import statements - beginning or middle?

https://www.python.org/dev/peps/pep-0008/#imports recommends to always import at the top of the file, just after any module comments and docstrings, and before module globals and constants.