when possible, imports should always be at the top. See PEP8 (http://www.python.org/dev/peps/pep-0008/).