<commit_before>(function() {
//import "../build/libogg.js"

var callbacks = [];
function AVMakeCallback(fn) {
    callbacks.push(fn);
    return callbacks.length - 1;
}

function AVRemoveCallback(callback) {
    callbacks.splice(callback, 1);
}

var OggDemuxer = AV.Demuxer.extend(function() {
    AV.Demuxer.register(this);
    
    this.probe = function(buffer) {
        return buffer.peekString(0, 4) === 'OggS';
    }
    
    var AVOggInit = Module.cwrap('AVOggInit', '*');
    var AVOggRead = Module.cwrap('AVOggRead', null, ['*', '*', 'number']);
    var AVOggDestroy = Module.cwrap('AVOggDestroy', null, ['*']);
    
    this.prototype.init = function() {
        this.ogg = AVOggInit();
        this.buf = _malloc(4096);
        
		this.realStream = this.stream;
		var format = null;
		var self = this;
		var flac = null;
		
		var list = new AV.BufferList();
		var stream = new AV.Stream(list);
		this.stream = stream;
                
        this.callback = AVMakeCallback(function(packet, bytes) {                        
        	var data = Module.HEAPU8.subarray(packet, packet + bytes);			
			list.append(new AV.Buffer(new Uint8Array(data)));
                        
        	if (!flac) {
				stream.advance(1);
            	if (stream.readString(4) != 'FLAC')
					throw new Error('Not flac');
					
				if (stream.readUInt8() != 1)
					throw new Error('Unsupported FLAC version');
					
				stream.advance(3);
				if (stream.peekString(0, 4) != 'fLaC')
					throw new Error('Not flac');
					
				flac = AV.Demuxer.find(new AV.Buffer(new Uint8Array(data.subarray(stream.offset))));
			}
				
			flac.prototype.readChunk.apply(self);
        });
    }
    
    this.prototype.readChunk = function() {<commit_msg>What are these silly tabs doing in my JS?!<commit_after>(function() {
//import "../build/libogg.js"

var callbacks = [];
function AVMakeCallback(fn) {
    callbacks.push(fn);
    return callbacks.length - 1;
}

function AVRemoveCallback(callback) {
    callbacks.splice(callback, 1);
}

var OggDemuxer = AV.Demuxer.extend(function() {
    AV.Demuxer.register(this);
    
    this.probe = function(buffer) {
        return buffer.peekString(0, 4) === 'OggS';
    }
    
    var AVOggInit = Module.cwrap('AVOggInit', '*');
    var AVOggRead = Module.cwrap('AVOggRead', null, ['*', '*', 'number']);
    var AVOggDestroy = Module.cwrap('AVOggDestroy', null, ['*']);
    
    this.prototype.init = function() {
        this.ogg = AVOggInit();
        this.buf = _malloc(4096);
        
        this.realStream = this.stream;
        var format = null;
        var self = this;
        var flac = null;
        
        var list = new AV.BufferList();
        var stream = new AV.Stream(list);
        this.stream = stream;
                
        this.callback = AVMakeCallback(function(packet, bytes) {                        
            var data = Module.HEAPU8.subarray(packet, packet + bytes);          
            list.append(new AV.Buffer(new Uint8Array(data)));
                        
            if (!flac) {
                stream.advance(1);
                if (stream.readString(4) != 'FLAC')
                    throw new Error('Not flac');
                    
                if (stream.readUInt8() != 1)
                    throw new Error('Unsupported FLAC version');
                    
                stream.advance(3);
                if (stream.peekString(0, 4) != 'fLaC')
                    throw new Error('Not flac');
                    
                flac = AV.Demuxer.find(new AV.Buffer(new Uint8Array(data.subarray(stream.offset))));
            }
                
            flac.prototype.readChunk.apply(self);
        });
    }
    
    this.prototype.readChunk = function() {
{'fraction_non_alphanumeric': 0.140491452991453, 'fraction_numerical': 0.009615384615384616, 'mean_word_length': 1.9349529780564263, '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': '3972538', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1164, 'n_words': 226}