snippets of useful python code