python snippets machine learning