Add python snippets to define functions and methods.