Revise layout of import statements

From  PEP8:

"Imports are always put at the top of the file, just after any module
comments and docstrings, and before module globals and constants.

Imports should be grouped in the following order:

1. standard library imports
2. related third party imports
3. local application/library specific imports

You should put a blank line between each group of imports."
Do not use wildcard imports

From PEP8:

"Wildcard imports (from <module> import *) should be avoided, as they
make it unclear which names are present in the namespace, confusing both
readers and many automated tools."
Add blank line at the end of docstrings
Merge branch 'make-code-comply-with-pep8-style' into next