<commit_before>(function() {
    
    // import
    var uri = "http://jugl.tschaub.net/trunk/lib/Jugl.js";
    var Jugl = window[uri];

    /**
     * Class: Jugl.Node
     * Instances of this class contain a DOM element and methods to process
     * Jugl statements.  Create a new instance with the {Jugl.Node}
     * constructor.
     */
    Jugl.Node = Jugl.Class({
        
        /**
         * Property: template
         * {<Jugl.Template>} The template that this node belongs to.
         */
        template: null,
        
        /**
         * Property: element
         * {DOMElement} The DOM element that this represents.
         */
        element: null,
        
        /**
         * Property: scope
         * {Object} Represents the scope for this node.  Any defined values or
         * repeat variables will become properties of this object.
         */
        scope: null,
        
        /**
         * Constructor: Jugl.Node
         * Create a new Jugl node.
         *
         * Parameters:
         * template - {Jugl.Template} The template that this node belongs to.
         * element - {DOMElement} The DOM element that this node represents.
         *
         * Return:
         * {Jugl.Node} A new Jugl node.
         */
        initialize: function(template, element) {
            this.template = template;
            this.element = element;
            this.scope = new Object();
            this.scope.repeat = new Object();
        },
        
        /**
         * Method: clone
         * Create a deep clone of this node
         *
         * Return:
         * {Jugl.Node} A cloned copy of this node.
         */
        clone: function() {
            var element = this.element.cloneNode(true);
            var node = new Jugl.Node(this.template, element);
            Jugl.Util.extend(node.scope, this.scope);
            return node;
        },
    
        /**
         * Method: getAttribute
         * Return an attribute from a node given a localName.
         *
         * Parameters:
         * localName - {String} The local name of the attribute
         *
         * Return
         * {<Jugl.Attribute>} The speficied attribute if it exists.  Returns false
         * if the attribute exists but is not specified.  Returns null if the
         * attribute doesn't exist.
         */
        getAttribute: function(localName) {
            var element;
            if(this.element.nodeType == 1) {
                if(this.template.usingNS) {
                    element = this.element.getAttributeNodeNS(Jugl.namespaceURI,
                                                              localName);
                } else {
                    element = this.element.getAttributeNode(Jugl.prefix + ":" +
                                                            localName);
                }
                if(element && !element.specified) {
                    element = false;
                }
            }
            var attribute;
            if(element) {
                attribute = new Jugl.Attribute(this, element, localName);
            } else {
                attribute = element;
            }
            return attribute;
        },
        
        /**
         * Method: setAttribute
         * Set an attribute on this node.  Doesn't currently support setting
         * attributes with namespaces.
         *
         * Parameters:
         * name - {String} Attribute name
         * value - {String} Attribute value
         */
        setAttribute: function(name, value) {
            this.element.setAttribute(name, value);
        },
        
        /**
         * Method: removeAttributeNode
         * Remove an attribute from this node.
         *
         * Parameters: 
         * attribute - {Jugl.Attribute} The attribute to be removed
         */
        removeAttributeNode: function(attribute) {
            this.element.removeAttributeNode(attribute.element);
        },
        
        /**
         * Method: getChildNodes
         * Get a list of child nodes.
         *
         * Return:
         * {Array(Jugl.Node)} An array of Jugl.Node children
         */
        getChildNodes: function() {
            var children = [];
            var node, scope;
            for(var i=0; i<this.element.childNodes.length; ++i) {
                node = new Jugl.Node(this.template, this.element.childNodes[i]);
                node.scope = Jugl.Util.extend({}, this.scope);
                children.push(node);
            }
            return children;
        },
        
        /**
         * Method: removeChildNodes
         * Remove all child nodes of this node
         */
        removeChildNodes: function() {<commit_msg>avoid array push<commit_after>(function() {
    
    // import
    var uri = "http://jugl.tschaub.net/trunk/lib/Jugl.js";
    var Jugl = window[uri];

    /**
     * Class: Jugl.Node
     * Instances of this class contain a DOM element and methods to process
     * Jugl statements.  Create a new instance with the {Jugl.Node}
     * constructor.
     */
    Jugl.Node = Jugl.Class({
        
        /**
         * Property: template
         * {<Jugl.Template>} The template that this node belongs to.
         */
        template: null,
        
        /**
         * Property: element
         * {DOMElement} The DOM element that this represents.
         */
        element: null,
        
        /**
         * Property: scope
         * {Object} Represents the scope for this node.  Any defined values or
         * repeat variables will become properties of this object.
         */
        scope: null,
        
        /**
         * Constructor: Jugl.Node
         * Create a new Jugl node.
         *
         * Parameters:
         * template - {Jugl.Template} The template that this node belongs to.
         * element - {DOMElement} The DOM element that this node represents.
         *
         * Return:
         * {Jugl.Node} A new Jugl node.
         */
        initialize: function(template, element) {
            this.template = template;
            this.element = element;
            this.scope = new Object();
            this.scope.repeat = new Object();
        },
        
        /**
         * Method: clone
         * Create a deep clone of this node
         *
         * Return:
         * {Jugl.Node} A cloned copy of this node.
         */
        clone: function() {
            var element = this.element.cloneNode(true);
            var node = new Jugl.Node(this.template, element);
            Jugl.Util.extend(node.scope, this.scope);
            return node;
        },
    
        /**
         * Method: getAttribute
         * Return an attribute from a node given a localName.
         *
         * Parameters:
         * localName - {String} The local name of the attribute
         *
         * Return
         * {<Jugl.Attribute>} The speficied attribute if it exists.  Returns false
         * if the attribute exists but is not specified.  Returns null if the
         * attribute doesn't exist.
         */
        getAttribute: function(localName) {
            var element;
            if(this.element.nodeType == 1) {
                if(this.template.usingNS) {
                    element = this.element.getAttributeNodeNS(Jugl.namespaceURI,
                                                              localName);
                } else {
                    element = this.element.getAttributeNode(Jugl.prefix + ":" +
                                                            localName);
                }
                if(element && !element.specified) {
                    element = false;
                }
            }
            var attribute;
            if(element) {
                attribute = new Jugl.Attribute(this, element, localName);
            } else {
                attribute = element;
            }
            return attribute;
        },
        
        /**
         * Method: setAttribute
         * Set an attribute on this node.  Doesn't currently support setting
         * attributes with namespaces.
         *
         * Parameters:
         * name - {String} Attribute name
         * value - {String} Attribute value
         */
        setAttribute: function(name, value) {
            this.element.setAttribute(name, value);
        },
        
        /**
         * Method: removeAttributeNode
         * Remove an attribute from this node.
         *
         * Parameters: 
         * attribute - {Jugl.Attribute} The attribute to be removed
         */
        removeAttributeNode: function(attribute) {
            this.element.removeAttributeNode(attribute.element);
        },
        
        /**
         * Method: getChildNodes
         * Get a list of child nodes.
         *
         * Return:
         * {Array(Jugl.Node)} An array of Jugl.Node children
         */
        getChildNodes: function() {
            var numNodes = this.element.childNodes.length;
            var children = new Array(numNodes);
            var node, scope;
            for(var i=0; i<numNodes; ++i) {
                node = new Jugl.Node(this.template, this.element.childNodes[i]);
                node.scope = Jugl.Util.extend({}, this.scope);
                children[i] = node;
            }
            return children;
        },
        
        /**
         * Method: removeChildNodes
         * Remove all child nodes of this node
         */
        removeChildNodes: function() {
{'fraction_non_alphanumeric': 0.09243697478991597, 'fraction_numerical': 0.0004201680672268908, 'mean_word_length': 1.2761176189337795, 'pattern_counts': {'":': 2, '<': 9, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4178531', 'n_tokens_mistral': 2379, 'n_tokens_neox': 2367, 'n_words': 662}