a few python snippets