<commit_before>NodeCompressor = require('./shared/node_compressor')
exports.deserialize = (nodes, components, client) ->
    for record in nodes
        record = NodeCompressor.uncompress(record)
        node = null

        # If the node already exists, we don't need to create it.
        # This can happen if a node is removed then re-added.
        if client.nodes.exists(record.id)
            # TODO: is this right?  we just don't want to retag, but we need
            # to re-add to DOM at the right place, don't we?
            #continue
            node = client.nodes.get(record.id)
            if node.parentNode != null
                throw new Error("Trying to add a node that already has a parent node.")

        parent = client.nodes.get(record.parent)
        # Note: If record.before is null, then the TaggedNodeCollection
        #       returns null.<commit_msg>deserializer update.<commit_after>NodeCompressor = require('./shared/node_compressor')
exports.deserialize = (nodes, components, client) ->
    for record in nodes
        record = NodeCompressor.uncompress(record)
        node = null

        # If the node already exists, we don't need to create it.
        # This can happen if a node is removed then re-added.
        if client.nodes.exists(record.id)
            # TODO: is this right?  we just don't want to retag, but we need
            # to re-add to DOM at the right place, don't we?
            #continue
            node = client.nodes.get(record.id)
            #if node.parentNode != null
            #    throw new Error("Trying to add a node that already has a parent node.")

        try
            parent = client.nodes.get(record.parent)
        catch e
            console.log e
            console.log e.stack
            console.log record
            console.log nodes
        # Note: If record.before is null, then the TaggedNodeCollection
        #       returns null.
{'fraction_non_alphanumeric': 0.07987551867219916, 'fraction_numerical': 0.0, 'mean_word_length': 1.98145285935085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6515526', 'n_tokens_mistral': 510, 'n_tokens_neox': 498, 'n_words': 193}