<commit_before>var Signals = function () {
    "use strict";

    var Signal = function () {

        this.registeredListeners = []
        this.accumulator = null
        this.previous = null
        this.folding = false
        this.__isSignal = true
    }

    Signal.prototype.currently = function (take) {
        var res = this.accumulator
        if(!this.folding && take) this.accumulator = undefined
        return res
    }

    Signal.prototype.was = function () {
        return this.previous
    }

    Signal.prototype.registerListener = function(callback) {
        window.debug && console.log("registering listener", callback, this)
        this.registeredListeners.push(function (value) {
            if(!callback) return
            UHCFunction.call(callback, value)
        })
    }

    Signal.prototype.push = function(value, event) {
        window.debug && console.log("received", value, event)
        if(this.registeredListeners.length === 0) {
            window.debug && console.log("evaluating", value)
            evaluate(value)
        } else for(var i = 0, len = this.registeredListeners.length; i < len; i++) {
            this.registeredListeners[i](value, event);
        }
    }

    Signal.prototype.pipe = function(transform, base) {
        window.debug && console.log("constructing with transform", transform)

        var newSignal = new Signal(), shouldAccumulate = base !== undefined
        newSignal.accumulator = base

        this.registeredListeners.push(function (value, event) {
            if(_e_(value)._tag_ && _e_(value)._tag_ === -1) return //empty signal
            var res = UHCFunction.call(transform, value, event)
            newSignal.previous = newSignal.accumulator
            if(shouldAccumulate) {
                window.debug && console.log("accumulating")
                newSignal.accumulator = UHCFunction.apply(transform, [value, newSignal.accumulator])
                newSignal.push(newSignal.accumulator)
            } else {
                window.debug && console.log("pushing res", window.res = res, window.transform = transform, window.value = value)
                newSignal.accumulator = res
                newSignal.push(res, event)
            }
        });
        return newSignal
    }

    Signal.prototype.__aN__ = function () { return this }

    Signal.prototype.sample = function (take) {
        window.debug && console.log("sampling ", this.currently())
        var sampled
        if(typeof (sampled = this.currently(true)) === "undefined" || sampled === null) {
            return emptySignal()<commit_msg>:feelsgood:<commit_after>var Signals = function () {
    "use strict";

    var Signal = function () {

        this.registeredListeners = []
        this.accumulator = null
        this.previous = null
        this.folding = false
        this.__isSignal = true
    }

    Signal.prototype.currently = function (take) {
        var res = this.accumulator
        if(!this.folding && take) this.accumulator = undefined
        return res
    }

    Signal.prototype.was = function () {
        return this.previous
    }

    Signal.prototype.registerListener = function(callback) {
        window.debug && console.log("registering listener", callback, this)
        this.registeredListeners.push(function (value) {
            if(!callback) return
            UHCFunction.call(callback, value)
        })
    }

    Signal.prototype.push = function(value, event) {
        window.debug && console.log("received", value, event)
        if(this.registeredListeners.length === 0) {
            window.debug && console.log("evaluating", value)
            evaluate(value)
        } else for(var i = 0, len = this.registeredListeners.length; i < len; i++) {
            this.registeredListeners[i](value, event)
        }
    }

    Signal.prototype.pipe = function(transform, base) {
        window.debug && console.log("constructing with transform", transform)

        var newSignal = new Signal(), shouldAccumulate = base !== undefined
        newSignal.accumulator = base

        this.registeredListeners.push(function (value, event) {
            if(_e_(value)._tag_ && _e_(value)._tag_ === -1) return //empty signal
            var res = UHCFunction.call(transform, value, event)
            newSignal.previous = newSignal.accumulator
            if(shouldAccumulate) {
                window.debug && console.log("accumulating")
                newSignal.accumulator = UHCFunction.apply(transform, [value, newSignal.accumulator])
                newSignal.push(newSignal.accumulator)
            } else {
                window.debug && console.log("pushing res", window.res = res, window.transform = transform, window.value = value)
                newSignal.accumulator = res
                newSignal.push(res, event)
            }
        })
        return newSignal
    }

    Signal.prototype.__aN__ = function () { return this }

    Signal.prototype.sample = function (take) {
        window.debug && console.log("sampling ", this.currently())
        var sampled
        if(typeof (sampled = this.currently(true)) === "undefined" || sampled === null) {
            return emptySignal()
{'fraction_non_alphanumeric': 0.11610918877354863, 'fraction_numerical': 0.0011534025374855825, 'mean_word_length': 2.2296710117939167, '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': '882529', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1345, 'n_words': 293}