Python snippets that I used frequently