<commit_before>import { findAncestor } from "./utils";

/**
 * Wraps a node in a query plan.
 */
class QpNode {
    constructor (readonly element:Element) {
        if (!this.element) throw new Error("element cannot be null");
        if (this.element.className != "qp-node") throw new Error("element must have class qp-node");
    }

    /**
     * Gets an array of child nodes.
     */
    get children(): Array<QpNode> {
        return [].slice.call(findAncestor(this.element, "qp-tr").children[1].children)
            .map(c => new QpNode(c.children[0].children[0].children[0]));
    }

    get nodeId(): string {
        let nodeId = this.element.attributes["data-node-id"];
        return nodeId && nodeId.value;
    }<commit_msg>Add comment for nodeId property<commit_after>import { findAncestor } from "./utils";

/**
 * Wraps a node in a query plan.
 */
class QpNode {
    constructor (readonly element:Element) {
        if (!this.element) throw new Error("element cannot be null");
        if (this.element.className != "qp-node") throw new Error("element must have class qp-node");
    }

    /**
     * Gets an array of child nodes.
     */
    get children(): Array<QpNode> {
        return [].slice.call(findAncestor(this.element, "qp-tr").children[1].children)
            .map(c => new QpNode(c.children[0].children[0].children[0]));
    }

    /**
     * Gets the NodeID.
     */
    get nodeId(): string {
        let nodeId = this.element.attributes["data-node-id"];
        return nodeId && nodeId.value;
    }
{'fraction_non_alphanumeric': 0.15339425587467362, 'fraction_numerical': 0.005221932114882507, 'mean_word_length': 2.5985915492957745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3974495', 'n_tokens_mistral': 482, 'n_tokens_neox': 474, 'n_words': 125}