<commit_before>"use strict"
!function() {
    var converters = {};
    var get = Ember.get, set = Ember.set;

    var getConverter = function(name) {
        return converters[name] || SimpleConverter.create({name: name});
    };

    var registerConverter = function(name, converter) {
        converters[name] = converter.create();
    };

    var SimpleConverter = Ember.Object.extend({
        init: function() {
            Ember.warn("Using Simple converter for " + this.get('name'), true);
        },

        convert: function(value) {
            if(value)
                return value.valueOf();
            return value;
        }
    })

    registerConverter('model', Ember.Object.extend({
        convert: function(value, options) {
            if(value instanceof options.destination)
                return value;
            else {
                if(typeof value === 'object') {
                    //try to build a new destination object
                    return options.destination.create(value);
                }
            }
            return null;
        }
    }));

    registerConverter('modelArray', Ember.Object.extend({
        convert: function(value, options) {
            if(value instanceof Array) {
                var array = [];
                for(var i = 0; i < value.length; i++) {
                    array.push(options.destination.create(value[i]))
                }
                return array;
            }
            return null;
        }
    }));

    registerConverter('string', SimpleConverter.extend({<commit_msg>Fix in model converter: check the value before create a new model<commit_after>"use strict"
!function() {
    var converters = {};
    var get = Ember.get, set = Ember.set;

    var getConverter = function(name) {
        return converters[name] || SimpleConverter.create({name: name});
    };

    var registerConverter = function(name, converter) {
        converters[name] = converter.create();
    };

    var SimpleConverter = Ember.Object.extend({
        init: function() {
            Ember.warn("Using Simple converter for " + this.get('name'), true);
        },

        convert: function(value) {
            if(value)
                return value.valueOf();
            return value;
        }
    })

    registerConverter('model', Ember.Object.extend({
        convert: function(value, options) {
            if(value instanceof options.destination)
                return value;
            else {
                if(value && typeof value === 'object') {
                    //try to build a new destination object
                    return options.destination.create(value);
                }
            }
            return null;
        }
    }));

    registerConverter('modelArray', Ember.Object.extend({
        convert: function(value, options) {
            if(value instanceof Array) {
                var array = [];
                for(var i = 0; i < value.length; i++) {
                    array.push(options.destination.create(value[i]))
                }
                return array;
            }
            return null;
        }
    }));

    registerConverter('string', SimpleConverter.extend({
{'fraction_non_alphanumeric': 0.11582891039650328, 'fraction_numerical': 0.0006244146113019045, 'mean_word_length': 1.6479338842975206, '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': '4079558', 'n_tokens_mistral': 818, 'n_tokens_neox': 778, 'n_words': 189}