Snippets of improved python code