def diff(text_1, text_2, filename_1, filename_2):
    lines_1 = text_1.split('\n')
    lines_2 = text_2.split('\n')
    diff_lines = unified_diff(lines_1, lines_2, filename_1, filename_2)
    # this next bit is needed to work around Python 2.6 difflib bug that left
    # in a trailing space after the filename if no date was provided. The
    # filename lines look like: '--- filename \n' where regular lines look
    # like '+foobar'. The space needs to be removed but the linefeed preserved.
    trimmed_lines = []
    for line in diff_lines:
        if line.endswith(' \n'):
            line = '%s\n' % line.rstrip()
        trimmed_lines.append(line)
    return '\n'.join(trimmed_lines)
Transform the dict to a model or entity instance(s).
dataset/ETHPy150Open python-openxml/opc-diag/opcdiag/presenter.py/diff--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/bulkload/bulkloader_config.py/DictConvertor.dict_to_entity