<commit_before>var Tweenable = require('shifty');

var EASING_ALIASES = {
    easeIn: 'easeInCubic',
    easeOut: 'easeOutCubic',
    easeInOut: 'easeInOutCubic'
};

// Base object for different progress bar shapes
var Progress = function(container, opts) {
    // Prevent calling constructor without parameters so inheritance
    // works correctly
    if (arguments.length === 0) return;

    var svgView = this._createSvgView(opts);

    var element;
    if (isString(container)) {
        element = document.querySelector(container);
    } else {
        element = container;
    }
    element.appendChild(svgView.svg);

    var newOpts = extend({
        attachment: this
    }, opts);
    this._path = new Path(svgView.path, newOpts);

    // Expose public attributes
    this.path = svgView.path;
    this.trail = svgView.trail;
};

Progress.prototype.animate = function animate(progress, opts, cb) {
    this._path.animate(progress, opts, cb);
};

Progress.prototype.stop = function stop() {
    this._path.stop();
};

Progress.prototype.set = function set(progress) {
    this._path.set(progress);
};

Progress.prototype.value = function value() {
    return this._path.value();
};

Progress.prototype._createSvgView = function _createSvgView(opts) {
    opts = extend({
        color: "#555",
        strokeWidth: 1.0,
        trailColor: null,
        fill: null
    }, opts);

    var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
    this._initializeSvg(svg, opts);

    var trailPath = null;
    if (opts.trailColor) {
        var trailOpts = extend({}, opts);
        trailOpts.color = opts.trailColor;
<commit_msg>Add destroy method and expose svg attribute<commit_after>var Tweenable = require('shifty');

var EASING_ALIASES = {
    easeIn: 'easeInCubic',
    easeOut: 'easeOutCubic',
    easeInOut: 'easeInOutCubic'
};

// Base object for different progress bar shapes
var Progress = function(container, opts) {
    // Prevent calling constructor without parameters so inheritance
    // works correctly
    if (arguments.length === 0) return;

    var svgView = this._createSvgView(opts);

    var element;
    if (isString(container)) {
        element = document.querySelector(container);
    } else {
        element = container;
    }
    element.appendChild(svgView.svg);

    var newOpts = extend({
        attachment: this
    }, opts);
    this._progressPath = new Path(svgView.path, newOpts);

    // Expose public attributes
    this.svg = svgView.svg;
    this.path = svgView.path;
    this.trail = svgView.trail;
};

Progress.prototype.animate = function animate(progress, opts, cb) {
    if (this._progressPath === null) throw new Error('Object is destroyed');
    this._progressPath.animate(progress, opts, cb);
};

Progress.prototype.stop = function stop() {
    if (this._progressPath === null) throw new Error('Object is destroyed');
    this._progressPath.stop();
};

Progress.prototype.destroy = function destroy() {
    if (this._progressPath === null) throw new Error('Object is destroyed');

    this.stop();
    this.svg.parentNode.removeChild(this.svg);
    this.svg = null;
    this.path = null;
    this.trail = null;
    this._progressPath = null;
};

Progress.prototype.set = function set(progress) {
    if (this._progressPath === null) throw new Error('Object is destroyed');
    this._progressPath.set(progress);
};

Progress.prototype.value = function value() {
    if (this._progressPath === null) throw new Error('Object is destroyed');
    return this._progressPath.value();
};

Progress.prototype._createSvgView = function _createSvgView(opts) {
    opts = extend({
        color: "#555",
        strokeWidth: 1.0,
        trailColor: null,
        fill: null
    }, opts);

    var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
    this._initializeSvg(svg, opts);

    var trailPath = null;
    if (opts.trailColor) {
        var trailOpts = extend({}, opts);
        trailOpts.color = opts.trailColor;

{'fraction_non_alphanumeric': 0.12933832709113607, 'fraction_numerical': 0.005493133583021223, 'mean_word_length': 3.1772679874869656, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3253265', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1223, 'n_words': 295}