<commit_before>define(
    [
        'libs/pixi.js/bin/pixi.dev'
    ],
    function (PIXI) {

        "use strict";

        var Surface = function (opts) {
            opts = opts || {};
            this.width = opts.width || 640;
            this.height = opts.height || 480;
            this.cx = this.width / 2;
            this.cy = this.height / 2;
            this.stage = new PIXI.Stage(0x000000, true);
            // this.renderer = new PIXI.WebGLRenderer(this.width, this.height);
            // this.renderer = new PIXI.CanvasRenderer(this.width, this.height);
            this.renderer = PIXI.autoDetectRenderer(this.width, this.height);
            this.renderer.view.style.display = 'block';
            document.body.appendChild(this.renderer.view);
            this.graphics = new PIXI.Graphics();
            this.stage.addChild(this.graphics);
            return this;
        };

        Surface.create = function (opts) {
            return new Surface(opts);
        };

        Surface.prototype = {

            clear: function () {
                this.graphics.clear();
            },

            polygon: function (points, color) {
                var graphics = this.graphics;
                var len = points.length;
                if (len) {
                    var point = points[0];
                    var x, y;
                    graphics.beginFill(color);
                    graphics.moveTo(point.x + this.cx, -point.y + this.cy);
                    for (var i = 1; i < len; i++) {
                        point = points[i];
                        graphics.lineTo(point.x + this.cx, -point.y + this.cy);
                    }
                    point = points[0];
                    graphics.lineTo(point.x + this.cx, -point.y + this.cy);<commit_msg>Add in weird conditional to change how a four+ sided polygon is rendered vs a three sided polygon.<commit_after>define(
    [
        'libs/pixi.js/bin/pixi.dev'
    ],
    function (PIXI) {

        "use strict";

        var Surface = function (opts) {
            opts = opts || {};
            this.width = opts.width || 640;
            this.height = opts.height || 480;
            this.cx = this.width / 2;
            this.cy = this.height / 2;
            this.stage = new PIXI.Stage(0x000000, true);
            // this.renderer = new PIXI.WebGLRenderer(this.width, this.height);
            // this.renderer = new PIXI.CanvasRenderer(this.width, this.height);
            this.renderer = PIXI.autoDetectRenderer(this.width, this.height);
            this.renderer.view.style.display = 'block';
            document.body.appendChild(this.renderer.view);
            this.graphics = new PIXI.Graphics();
            this.stage.addChild(this.graphics);
            return this;
        };

        Surface.create = function (opts) {
            return new Surface(opts);
        };

        Surface.prototype = {

            clear: function () {
                this.graphics.clear();
            },

            polygon: function (points, color) {

                var graphics = this.graphics;
                var len = points.length;
                if (len) {

                    var point, firstPoint = points[0];
                    var x, y, i;
                    graphics.beginFill(color);
                    graphics.moveTo(firstPoint.x + this.cx, -firstPoint.y + this.cy);
                    for (i = 1; i < len; i++) {
                        point = points[i];
                        graphics.lineTo(point.x + this.cx, -point.y + this.cy);
                    }
                    // TODO: examine why this is necessary
                    if (len === 3) {
                        graphics.lineTo(firstPoint.x + this.cx, -firstPoint.y + this.cy);
                    }
{'fraction_non_alphanumeric': 0.11982053312219583, 'fraction_numerical': 0.009501187648456057, 'mean_word_length': 1.3081607795371497, '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': '5144915', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1010, 'n_words': 224}