<commit_before>(function() {
    'use strict';
    var DoublyLinkedList = function() {
        var root, tail, count = 0;
        root = tail = null;

        function Node(element) {
            this.element = element || null;
            this.next = this.previous = null;
        }

        function add(element) {
            var node = new Node(element),
                current = null;
            if (root === null) {
                root = node;
            } else {
                current = root;
                while (current.next !== null) {
                    current = current.next;
                }
                current.next = tail = node;
            }
            count++;
        }

        function remove(index) {
			var node = get(index? index : count - 1);
			if (typeof index !== 'undefined') {
				root = removeAt(index, root);
			} else {
				root = removeAt(count - 1, root);
			}
			count--;
			return node;
        }

        function removeAt(index, node) {
        	if (node === null) {
        		throw new Error('removeAt(): No such element found.');
        	} else if (index === 0) {
        		return node.next;
        	} else {
        		node.next = removeAt(index - 1, node.next);
        	}
        	return node;
        }

        function first() {
            if (isEmpty()) {
                throw new Error('first(): List is empty.');
            }
            return root;
        }

        function get(index) {
            if (index < 0 || index > count || root === null) {
                return null;
            }
            var midPoint = count / 2,
                current, i;

            if (index > midPoint) {
                current = tail;
                for (i = count; i > index; i--) {
                    current = current.next;
                }
            } else {
                current = root;
                for (i = 0; i < index; i++) {
                    current = current.next;
                }
            }
            return current;
        }

        function isEmpty() {
            return count === 0;
        }

        function size() {
            return count;
        }

        return {
            add: add,
            remove: remove,
            first: first,
            get: get,
            isEmpty: isEmpty,
            size: size
        };
    };

    if (typeof define === 'function' && define.amd) {
        define(function() {
            return DoublyLinkedList;
        });
    } else if (typeof module !== 'undefined' && module.exports) {
        module.exports = DoublyLinkedList;
    } else {
        window.DoublyLinkedList = DoublyLinkedList;
    }
})();<commit_msg>indentation fix<commit_after>(function() {
	'use strict';
	var DoublyLinkedList = function() {
		var root, tail, count = 0;
		root = tail = null;

		function Node(element) {
			this.element = element || null;
			this.next = this.previous = null;
		}

		function add(element) {
			var node = new Node(element),
				current = null;
			if (root === null) {
				root = node;
			} else {
				current = root;
				while (current.next !== null) {
					current = current.next;
				}
				current.next = tail = node;
			}
			count++;
		}

		function remove(index) {
			var node = get(index ? index : count - 1);
			if (typeof index !== 'undefined') {
				root = removeAt(index, root);
			} else {
				root = removeAt(count - 1, root);
			}
			count--;
			return node;
		}

		function removeAt(index, node) {
			if (node === null) {
				throw new Error('removeAt(): No such element found.');
			} else if (index === 0) {
				return node.next;
			} else {
				node.next = removeAt(index - 1, node.next);
			}
			return node;
		}

		function first() {
			if (isEmpty()) {
				throw new Error('first(): List is empty.');
			}
			return root;
		}

		function get(index) {
			if (index < 0 || index > count || root === null) {
				return null;
			}
			var midPoint = count / 2,
				current, i;

			if (index > midPoint) {
				current = tail;
				for (i = count; i > index; i--) {
					current = current.next;
				}
			} else {
				current = root;
				for (i = 0; i < index; i++) {
					current = current.next;
				}
			}
			return current;
		}

		function isEmpty() {
			return count === 0;
		}

		function size() {
			return count;
		}

		return {
			add: add,
			remove: remove,
			first: first,
			get: get,
			isEmpty: isEmpty,
			size: size
		};
	};

	if (typeof define === 'function' && define.amd) {
		define(function() {
			return DoublyLinkedList;
		});
	} else if (typeof module !== 'undefined' && module.exports) {
		module.exports = DoublyLinkedList;
	} else {
		window.DoublyLinkedList = DoublyLinkedList;
	}
})();
{'fraction_non_alphanumeric': 0.13179782469609724, 'fraction_numerical': 0.003838771593090211, 'mean_word_length': 1.5093632958801497, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '98385', 'n_tokens_mistral': 1623, 'n_tokens_neox': 1371, 'n_words': 385}