Python code associated to the blog post "Where is my direction pole?"