modify some python snippets