<commit_before>"use strict";

const TsReader = require("../reader");

class TsDataModuleLogo {
    constructor(buffer) {
        this._buffer = buffer;
    }

    decode() {
        const reader = new TsReader(this._buffer);
        const objDataModule = {};

        objDataModule.logo_type = reader.uimsbf(8);
        objDataModule.number_of_loop = reader.uimsbf(16);
        objDataModule.logos = [];

        for (let i = 0; i < objDataModule.number_of_loop; i++) {
            const logo = {};

            reader.next(7);    // reserved
            logo.logo_id = reader.uimsbf(9);
            logo.number_of_services = reader.uimsbf(8);
            logo.services = [];

            for (let j = 0; j < logo.number_of_services; j++) {
                const service = {};

                service.original_network_id = reader.uimsbf(16);
                service.transport_stream_id = reader.uimsbf(16);
                service.service_id = reader.uimsbf(16);

                logo.services.push(service);
            }

            logo.data_size = reader.uimsbf(16);
            logo.data = reader.readBytes(logo.data_size);
        }

        return objDataModule;
    }
}

module.exports = TsDataModuleLogo;<commit_msg>Fix a bug of data module logo<commit_after>"use strict";

const TsReader = require("../reader");

class TsDataModuleLogo {
    constructor(buffer) {
        this._buffer = buffer;
    }

    decode() {
        const reader = new TsReader(this._buffer);
        const objDataModule = {};

        objDataModule.logo_type = reader.uimsbf(8);
        objDataModule.number_of_loop = reader.uimsbf(16);
        objDataModule.logos = [];

        for (let i = 0; i < objDataModule.number_of_loop; i++) {
            const logo = {};

            reader.next(7);    // reserved
            logo.logo_id = reader.uimsbf(9);
            logo.number_of_services = reader.uimsbf(8);
            logo.services = [];

            for (let j = 0; j < logo.number_of_services; j++) {
                const service = {};

                service.original_network_id = reader.uimsbf(16);
                service.transport_stream_id = reader.uimsbf(16);
                service.service_id = reader.uimsbf(16);

                logo.services.push(service);
            }

            logo.data_size = reader.uimsbf(16);
            logo.data = reader.readBytes(logo.data_size);
            
            objDataModule.logos.push(logo);
        }

        return objDataModule;
    }
}

module.exports = TsDataModuleLogo;
{'fraction_non_alphanumeric': 0.11832212109220419, 'fraction_numerical': 0.012663237039968342, 'mean_word_length': 1.8629671574178936, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3590048', 'n_tokens_mistral': 780, 'n_tokens_neox': 736, 'n_words': 130}