<commit_before>const Notify = require("./notify") 
module.exports= function(){
    const notify = Notify()
    let queue = []
    return {
        emit:function(event){
            if(queue)return queue.push(event)
            notify(event)
        },
        listen:function(){
            const source = notify.listen()
            if(queue){
                queue.forEach(notify)
                queue = null
            }
          
            return source
        },
        end:notify.end
    }<commit_msg>fix for events<commit_after>var Notify = require("./notify") 
module.exports= function(){
    var notify = Notify()
    var queue = []
    return {
        emit:function(event){
            if(queue)return queue.push(event)
            notify(event)
        },
        listen:function(){
            var source = notify.listen()
            if(queue){
                queue.forEach(notify)
                queue = null
            }
          
            return source
        },
        end:notify.end
    }
{'fraction_non_alphanumeric': 0.10948191593352884, 'fraction_numerical': 0.0, 'mean_word_length': 1.3648960739030023, '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': '1256964', 'n_tokens_mistral': 265, 'n_tokens_neox': 259, 'n_words': 54}