def match_blocks(hash_func, old_children, new_children):
sm = difflib.SequenceMatcher(<EOL>_is_junk,<EOL>a=[hash_func(c) for c in old_children],<EOL>b=[hash_func(c) for c in new_children],<EOL>)<EOL>return sm<EOL>
Use difflib to find matching blocks.