human
Complete the below
def diff_text(a, b):

    ''''Performs a diffing algorithm on two pieces of text. Returns
    a string of HTML containing the content of both texts with
    <span> tags inserted indicating where the differences are.'
    '''

Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def tokenise(text):
        u'\n                                Tokenises    a    string    by    spliting    it    into    individual    characters\n                                and    grouping    the    alphanumeric    ones    together.\n\n                                This    means    that    punctuation,    whitespace,    CJK    characters,    etc\n                                become    separate    tokens    and    words/numbers    are    merged    together\n                                to    form    bigger    tokens.\n\n                                This    makes    the    output    of    the    diff    easier    to    read    as    words    are\n                                not    broken    up.\n                                '
        tokens = []
        current_token = u''
        for c in text:
            if c.isalnum():
                current_token += c
            else:
                if current_token:
                    tokens.append(current_token)
                    current_token = u''
                tokens.append(c)
        if current_token:
            tokens.append(current_token)
        return tokens
    a_tok = tokenise(a)
    b_tok = tokenise(b)
    sm = difflib.SequenceMatcher((lambda t: (len(t) <= 4)), a_tok, b_tok)
    changes = []
    for (op, i1, i2, j1, j2) in sm.get_opcodes():
        if (op == u'replace'):
            for token in a_tok[i1:i2]:
                changes.append((u'deletion', token))
            for token in b_tok[j1:j2]:
                changes.append((u'addition', token))
        elif (op == u'delete'):
            for token in a_tok[i1:i2]:
                changes.append((u'deletion', token))
        elif (op == u'insert'):
            for token in b_tok[j1:j2]:
                changes.append((u'addition', token))
        elif (op == u'equal'):
            for token in a_tok[i1:i2]:
                changes.append((u'equal', token))
    merged_changes = []
    current_value = []
    current_change_type = None
    for (change_type, value) in...