<commit_before>Object.assign(pc, function () {

    /**
     * @class
     * @name pc.ContainerResource
     * @classdesc Container for a list of animations, textures, materials and a model.
     * @param {object} data - The loaded GLB data.
     */
    var ContainerResource = function (data) {
        this.data = data;
        this.model = null;
        this.materials = [];
        this.textures = [];
        this.animations = [];
        this.registry = null;
    };

    Object.assign(ContainerResource.prototype, {
        destroy: function () {

            var registry = this.registry;

            var destroyAsset = function (asset) {
                registry.remove(asset);
                asset.unload();
            };

            var destroyAssets = function (assets) {
                assets.forEach(function (asset) {
                    destroyAsset(asset);
                });
            };

            // unload and destroy assets
            if (this.animations) {
                destroyAssets(this.animations);
                this.animations = null;
            }

            if (this.textures) {
                destroyAssets(this.textures);
                this.textures = null;
            }

            if (this.materials) {
                destroyAssets(this.materials);
                this.materials = null;
            }

            if (this.model) {
                destroyAsset(this.model);
                this.model = null;
            }

            this.data = null;
            this.assets = null;
        }
    });

    /**
     * @class
     * @name pc.ContainerHandler
     * @implements {pc.ResourceHandler}
     * @classdesc Loads files that contain in them multiple resources. For example GLB files which can contain
     * textures, models and animations.
     * @param {pc.GraphicsDevice} device - The graphics device that will be rendering.
     * @param {pc.StandardMaterial} defaultMaterial - The shared default material that is used in any place that a material is not specified.
     */
    var ContainerHandler = function (device, defaultMaterial) {
        this._device = device;
        this._defaultMaterial = defaultMaterial;
    };

    Object.assign(ContainerHandler.prototype, {
        _getUrlWithoutParams: function (url) {
            return url.indexOf('?') >= 0 ? url.split('?')[0] : url;
        },

        load: function (url, callback, asset) {
            if (typeof url === 'string') {
                url = {
                    load: url,
                    original: url
                };
            }

            var options = {
                responseType: pc.Http.ResponseType.ARRAY_BUFFER,
                retry: false
            };

            var self = this;

            pc.http.get(url.load, options, function (err, response) {
                if (!callback)
                    return;

                if (!err) {
                    pc.GlbParser.parseAsync(self._getUrlWithoutParams(url.original),
                                            pc.path.extractPath(url.original),
                                            response,
                                            self._device,
                                            asset.registry,
                                            function (err, result) {
                                                if (err) {
                                                    callback(err);
                                                } else {
                                                    // return everything
                                                    callback(null, new ContainerResource(result));
                                                }
                                            });
                } else {
                    callback(pc.string.format("Error loading model: {0} [{1}]", url.original, err));
                }
            });
        },

        open: function (url, data, asset) {
            return data;
        },<commit_msg>use the correct url for extracting urlBase (#2143)<commit_after>Object.assign(pc, function () {

    /**
     * @class
     * @name pc.ContainerResource
     * @classdesc Container for a list of animations, textures, materials and a model.
     * @param {object} data - The loaded GLB data.
     */
    var ContainerResource = function (data) {
        this.data = data;
        this.model = null;
        this.materials = [];
        this.textures = [];
        this.animations = [];
        this.registry = null;
    };

    Object.assign(ContainerResource.prototype, {
        destroy: function () {

            var registry = this.registry;

            var destroyAsset = function (asset) {
                registry.remove(asset);
                asset.unload();
            };

            var destroyAssets = function (assets) {
                assets.forEach(function (asset) {
                    destroyAsset(asset);
                });
            };

            // unload and destroy assets
            if (this.animations) {
                destroyAssets(this.animations);
                this.animations = null;
            }

            if (this.textures) {
                destroyAssets(this.textures);
                this.textures = null;
            }

            if (this.materials) {
                destroyAssets(this.materials);
                this.materials = null;
            }

            if (this.model) {
                destroyAsset(this.model);
                this.model = null;
            }

            this.data = null;
            this.assets = null;
        }
    });

    /**
     * @class
     * @name pc.ContainerHandler
     * @implements {pc.ResourceHandler}
     * @classdesc Loads files that contain in them multiple resources. For example GLB files which can contain
     * textures, models and animations.
     * @param {pc.GraphicsDevice} device - The graphics device that will be rendering.
     * @param {pc.StandardMaterial} defaultMaterial - The shared default material that is used in any place that a material is not specified.
     */
    var ContainerHandler = function (device, defaultMaterial) {
        this._device = device;
        this._defaultMaterial = defaultMaterial;
    };

    Object.assign(ContainerHandler.prototype, {
        _getUrlWithoutParams: function (url) {
            return url.indexOf('?') >= 0 ? url.split('?')[0] : url;
        },

        load: function (url, callback, asset) {
            if (typeof url === 'string') {
                url = {
                    load: url,
                    original: url
                };
            }

            var options = {
                responseType: pc.Http.ResponseType.ARRAY_BUFFER,
                retry: false
            };

            var self = this;

            pc.http.get(url.load, options, function (err, response) {
                if (!callback)
                    return;

                if (!err) {
                    pc.GlbParser.parseAsync(self._getUrlWithoutParams(url.original),
                                            pc.path.extractPath(url.load),
                                            response,
                                            self._device,
                                            asset.registry,
                                            function (err, result) {
                                                if (err) {
                                                    callback(err);
                                                } else {
                                                    // return everything
                                                    callback(null, new ContainerResource(result));
                                                }
                                            });
                } else {
                    callback(pc.string.format("Error loading model: {0} [{1}]", url.original, err));
                }
            });
        },

        open: function (url, data, asset) {
            return data;
        },
{'fraction_non_alphanumeric': 0.09218807848944835, 'fraction_numerical': 0.001480932987782303, 'mean_word_length': 1.081150487930149, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5801472', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1728, 'n_words': 449}