Useful Snippets in Python