def unhash(text, hashes):
def retrieve_match(match):<EOL><INDENT>return hashes[match.group(<NUM_LIT:0>)]<EOL><DEDENT>while re_hash.search(text):<EOL><INDENT>text = re_hash.sub(retrieve_match, text)<EOL><DEDENT>text = re_pre_tag.sub(lambda m: re.sub('<STR_LIT>' + m.group(<NUM_LIT:1>), '<STR_LIT>', m.group(<NUM_LIT:0>), flags=re.M), text)<EOL>return text<EOL>
Unhashes all hashed entites in the hashes dictionary.

    The pattern for hashes is defined by re_hash. After everything is
    unhashed, <pre> blocks are "pulled out" of whatever indentation
    level in which they used to be (e.g. in a list).