python based code snippets