<commit_before>(function(root){

    /*
    element: The dataElement to create a dependency on
    dependentOnElement: The element it should depend on
     */
    root.addDependency = function(parentElement, element) {
        var deferred = new $.Deferred();
        var dependency = {
            id: parentElement.id,
            triggers: []
        };
        if(parentElement.type === "trueOnly") {
            dependency.triggers.push(true);
        } else if(parentElement.type === "bool") {
            dependency.triggers.push(element.triggerOption() === "Yes");
        } else if(parentElement.type === "int") {
            if(element.interval()) {
                dependency.triggers.push({from: parseInt(element.lowerLimit()), to: parseInt(element.upperLimit())});
            } else {
                dependency.triggers = $.map(element.commaList().split(","), function(num) {
                    if(!isNaN(num)) {
                        return parseInt(num);
                    }
                });
            }
        } else if(parentElement.type === "string" || parentElement.type === "string with optionSet") {
            dependency.triggers = element.commaList().split(",");
        } else if(parentElement.type === "date") {
            if(element.interval()) {
                dependency.triggers.push({from: element.lowerLimit(), to: element.upperLimit()});
            } else {
                dependency.triggers.push(element.commaList());
            }
        } else if (parentElement.type === "string with optionSet") {
            //TODO: Something should be done here, but not this:
            dependency.triggers = ["I'm not implemented! :D (dependencyHandler.addDependency())"];
        } else {
            deferred.reject("No such type");
        }

        addOrUpdateDependency(element, dependency);
        deferred.resolve();
        return deferred.promise();
    };

    root.removeDependency = function(parentElement, element) {
        var deps = element.dependencies;
        for(var i = 0; i < deps.length; i++) {
            if(deps[i].id == parentElement.id) {
                deps.splice(i, 1);
            }
        }
    };

    root.hasDependency = function(element, potentialParent) {
        var deps = element.dependencies;
        if(!deps) {
            return false;<commit_msg>Removed unimplemented version of string with optionset.<commit_after>(function(root){

    /*
    element: The dataElement to create a dependency on
    dependentOnElement: The element it should depend on
     */
    root.addDependency = function(parentElement, element) {
        var deferred = new $.Deferred();
        var dependency = {
            id: parentElement.id,
            triggers: []
        };
        if(parentElement.type === "trueOnly") {
            dependency.triggers.push(true);
        } else if(parentElement.type === "bool") {
            dependency.triggers.push(element.triggerOption() === "Yes");
        } else if(parentElement.type === "int") {
            if(element.interval()) {
                dependency.triggers.push({from: parseInt(element.lowerLimit()), to: parseInt(element.upperLimit())});
            } else {
                dependency.triggers = $.map(element.commaList().split(","), function(num) {
                    if(!isNaN(num)) {
                        return parseInt(num);
                    }
                });
            }
        } else if(parentElement.type === "string" || parentElement.type === "string with optionSet") {
            dependency.triggers = element.commaList().split(",");
        } else if(parentElement.type === "date") {
            if(element.interval()) {
                dependency.triggers.push({from: element.lowerLimit(), to: element.upperLimit()});
            } else {
                dependency.triggers.push(element.commaList());
            }
        } else {
            deferred.reject("No such type");
        }

        addOrUpdateDependency(element, dependency);
        deferred.resolve();
        return deferred.promise();
    };

    root.removeDependency = function(parentElement, element) {
        var deps = element.dependencies;
        for(var i = 0; i < deps.length; i++) {
            if(deps[i].id == parentElement.id) {
                deps.splice(i, 1);
            }
        }
    };

    root.hasDependency = function(element, potentialParent) {
        var deps = element.dependencies;
        if(!deps) {
            return false;
{'fraction_non_alphanumeric': 0.1356649587881488, 'fraction_numerical': 0.0008910670527957229, 'mean_word_length': 1.9193758127438232, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5806637', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1153, 'n_words': 234}