Python code for the post "Stable Marriages and Designing Markets"