Imports should ALWAYS be at the top, unless you have a specific reason to not do it that way. If you don't know what your reason is then you probably wanted it at the top.


A good reason to not put an import at the top is for example look at the startup scripts that support GUI and CLI modes.