How to solve circular / recursive import error in python

Circular / recursive import error occurs when you try to

import a1 from

in the, which is also used in a1 in

The solution is to import functions directly in the function body, not in the beginning of the module.

If you have a better approach, you are very welcome to suggest it on the SO question.