def html_annotate_merge_annotations(tokens_old, tokens_new):
 s = InsensitiveSequenceMatcher(a=tokens_old, b=tokens_new)
 commands = s.get_opcodes()
 for (command, i1, i2, j1, j2) in commands:
  if (command == 'equal'):
   eq_old = tokens_old[i1:i2]
   eq_new = tokens_new[j1:j2]
   copy_annotations(eq_old, eq_new)

def html_annotate_merge_annotations ( tokens_old , tokens_new ) : s = InsensitiveSequenceMatcher ( a = tokens_old , b = tokens_new ) commands = s . get_opcodes ( ) for ( command , i1 , i2 , j1 , j2 ) in commands : if ( command == 'equal' ) : eq_old = tokens_old [ i1 : i2 ] eq_new = tokens_new [ j1 : j2 ] copy_annotations ( eq_old , eq_new )
merge the annotations from tokens_old into tokens_new .