<commit_before>define(['underscore', 'models/base', 'models/machine', 'collections/machines'],
function(_, Base, Machine, Machines) {

    var Application = Base.extend({
        defaults: { 'model_name': 'application' },
        parse: function(response) {
            var attributes = response;
            attributes.id = response.uuid;
            attributes.rating = Math.floor(Math.random() * 6);
            attributes.favorite = response.is_bookmarked;
            var machines = _.map(attributes.machines, function(attrs) {
                return new Machine(Machine.prototype.parse(attrs));
            });
            attributes.machines = new Machines(machines);
            return attributes;
        },
        url: function(){
            var url = this.urlRoot
                + '/' + this.defaults.model_name + '/';
            
            if (typeof this.get('id') != 'undefined') {
                url += this.get('id') + '/';
            }
            
            return url;
        },
        computed: {
            name_or_id: function() {
                return this.get('name') || this.get('id');
            }
        }
    });

    _.extend(Application.defaults, Base.defaults);

    return Application;
});<commit_msg>remove trailing slash for individual applications<commit_after>define(['underscore', 'models/base', 'models/machine', 'collections/machines'],
function(_, Base, Machine, Machines) {

    var Application = Base.extend({
        defaults: { 'model_name': 'application' },
        parse: function(response) {
            var attributes = response;
            attributes.id = response.uuid;
            attributes.rating = Math.floor(Math.random() * 6);
            attributes.favorite = response.is_bookmarked;
            var machines = _.map(attributes.machines, function(attrs) {
                return new Machine(Machine.prototype.parse(attrs));
            });
            attributes.machines = new Machines(machines);
            return attributes;
        },
        url: function(){
            var url = this.urlRoot
                + '/' + this.defaults.model_name + '/';
            
            if (typeof this.get('id') != 'undefined') {
                url += this.get('id');
            }
            
            return url;
        },
        computed: {
            name_or_id: function() {
                return this.get('name') || this.get('id');
            }
        }
    });

    _.extend(Application.defaults, Base.defaults);

    return Application;
});
{'fraction_non_alphanumeric': 0.1337025316455696, 'fraction_numerical': 0.0007911392405063291, 'mean_word_length': 1.751904243743199, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3620890', 'n_tokens_mistral': 662, 'n_tokens_neox': 634, 'n_words': 129}