<commit_before>define(['logger', 'voc', 'underscore', 'data/Data' ], function(Logger, Voc, _, Data){
    var m = Object.create(Data);
    m.init = function(vie) {
        this.LOG.debug("initialize UserEventData");
        this.vie = vie;
        this.vie.entities.on('add', this.filter, this);
        this.setIntegrityCheck(Voc.belongsToTimeline, Voc.TIMELINE, Voc.hasEntity);
    };
    m.LOG = Logger.get('UserEventData');
    /** 
     * Filters entities from added entities to vie.entities
     */
    m.filter= function(model, collection, options) {
        if(model.isof(Voc.USEREVENT)){
            this.checkIntegrity(model, options);<commit_msg>UserEventData auto fetch of related resource<commit_after>define(['logger', 'voc', 'underscore', 'data/Data' ], function(Logger, Voc, _, Data){
    var m = Object.create(Data);
    m.init = function(vie) {
        this.LOG.debug("initialize UserEventData");
        this.vie = vie;
        this.vie.entities.on('add', this.filter, this);
        this.setIntegrityCheck(Voc.hasResource, Voc.THING);
        this.setIntegrityCheck(Voc.belongsToTimeline, Voc.TIMELINE, Voc.hasEntity);
    };
    m.LOG = Logger.get('UserEventData');
    /** 
     * Filters entities from added entities to vie.entities
     */
    m.filter= function(model, collection, options) {
        if(model.isof(Voc.USEREVENT)){
            this.checkIntegrity(model, options);
            var resource = model.get(Voc.hasResource);
            this.LOG.debug("resource", resource );
            if( resource.isEntity ) {
                resource.fetch();
            }
{'fraction_non_alphanumeric': 0.14545454545454545, 'fraction_numerical': 0.0, 'mean_word_length': 2.8, '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': '2116069', 'n_tokens_mistral': 496, 'n_tokens_neox': 492, 'n_words': 90}