It seems like `count_similar_lines()` could be implemented without new logic by re-using the diff function:

    before_lines = cell['input']
    after_lines = cell['input']
    result = diff(before_lines, after_lines)
    unmodified_lines = [r for r in result if r['state'] == 'unmodified']
    return float(len(unmodified_lines))/len(result)

I'm not sure I'm doing the math right here, but you get the idea.