useful Python snippets