python useful snippets