<commit_before>(function(global) {
    'use strict';
    var CanvasVault = function() {
        this.canvas = null;
        this.canvasContext = null;
    };

    var Canvas   = function(settings) {
        settings = settings || {};
        this.settings = {
            height: 750,
            width:  750,
            backgroundColor: 'rgba(255, 255, 255, 1)',
            style: 'border: 1px solid #fff'
        };

        for(var attrName in settings) {
            this.settings[attrName] = settings[attrName];
        }

        this.canvasElement = null;
        this.canvasContext = null;
        this.setupCanvas();
    };

    Canvas.prototype.setupCanvas  = function() {
        this.canvasElement        = global.document.createElement('canvas');
        this.canvasElement.width  = this.settings.width;
        this.canvasElement.height = this.settings.height;
        this.canvasElement.style  = this.settings.style;

        this.canvasContext        = this.canvasElement.getContext('2d');

        this.canvasContext.fillStyle = this.backgroundColor;
        this.canvasContext.fillRect(0, 0, this.settings.width, this.settings.height);
    };

    Canvas.prototype.isEmpty = function(x, y, width, height) {
        height = height || 1;
        width  = width  || 1;
        var available = true;

        var colors = this.canvasContext.getImageData(x, y, width, height).data;
        var _i;
        for(_i=0; _i<colors.length-1; _i+=4) {
            if(colors[_i] !== 255 || colors[_i+1] !== 255 || colors[_i+2] !== 255) {
                return false;
            }
        }

        return true;
    };

    Canvas.prototype.clearPixels = function(x, y, width, height) {
        width  = width  || 1;
        height = height || 1;
        this.canvasContext.fillStyle = 'rgb(255, 255, 255, 1)';
        this.canvasContext.fillRect(x, y, width, height);
    };

    if(typeof global.xEvolution === 'undefined') {
        Object.defineProperty(global, 'xEvolution', {
            writable : false,
            enumerable : false,
            configurable : false,
            value: {}<commit_msg>Some private canvas variables to protect them<commit_after>(function(global) {
    'use strict';
    var CanvasVault = function() {
        this.canvas = null;
        this.canvasContext = null;
    };
    var vault = new CanvasVault();

    var Canvas   = function(settings) {
        settings = settings || {};
        this.settings = {
            height: 750,
            width:  750,
            backgroundColor: 'rgba(255, 255, 255, 1)',
            style: 'border: 1px solid #fff'
        };

        for(var attrName in settings) {
            this.settings[attrName] = settings[attrName];
        }

        this.setupCanvas();
    };

    Canvas.prototype.setupCanvas  = function() {
        vault.canvas        = global.document.createElement('canvas');
        vault.canvas.width  = this.settings.width;
        vault.canvas.height = this.settings.height;
        vault.canvas.style  = this.settings.style;

        vault.canvasContext        = vault.canvas.getContext('2d');

        vault.canvasContext.fillStyle = this.settings.backgroundColor;
        vault.canvasContext.fillRect(0, 0, this.settings.width, this.settings.height);
    };

    Canvas.prototype.isEmpty = function(x, y, width, height) {
        height = height || 1;
        width  = width  || 1;
        var available = true;

        var colors = vault.canvasContext.getImageData(x, y, width, height).data;
        var _i;
        for(_i=0; _i<colors.length-1; _i+=4) {
            if(colors[_i] !== 255 || colors[_i+1] !== 255 || colors[_i+2] !== 255) {
                return false;
            }
        }

        return true;
    };

    Canvas.prototype.clearPixels = function(x, y, width, height) {
        width  = width  || 1;
        height = height || 1;
        vault.canvasContext.fillStyle = 'rgb(255, 255, 255, 1)';
        vault.canvasContext.fillRect(x, y, width, height);
    };

    Canvas.prototype.getCanvas = function() {
        return vault.canvas;
    };

    Canvas.prototype.getCanvasContext = function() {
        return vault.canvasContext;
    };

    if(typeof global.xEvolution === 'undefined') {
        Object.defineProperty(global, 'xEvolution', {
            writable : false,
            enumerable : false,
            configurable : false,
            value: {}
{'fraction_non_alphanumeric': 0.12829246139872844, 'fraction_numerical': 0.021798365122615803, 'mean_word_length': 2.006825938566553, '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': '6289398', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1255, 'n_words': 266}