Various python snippets of code