<commit_before>var canvas = $c.getContext('2d')

function paintLevel(level) {
    var i, j

    canvas.beginPath()

    for (i = 16; i--;) {
        for (j = 9; j--;) {
            if (level.a[j][i] == 'x') {
                canvas.rect(cellsize * i, cellsize * j, cellsize, cellsize)
            }
        }
    }

    canvas.fillStyle = '#586E75'
    canvas.fill()


    canvas.beginPath()

    level.p.concat(level.w)
    .forEach(function (platform) {
        canvas.moveTo(platform[0].x, platform[0].y)
        canvas.lineTo(platform[1].x, platform[1].y)
    })

    canvas.lineWidth = 2
    canvas.strokeStyle = '#EEFF41'
    canvas.stroke()
}


paintLevel(levels[0])<commit_msg>Pattern<commit_after>var canvas = $c.getContext('2d')

function paintLevel(level) {
    var i, j

    canvas.beginPath()

    for (i = 16; i--;) {
        for (j = 9; j--;) {
            if (level.a[j][i] == 'x') {
                canvas.rect(cellsize * i, cellsize * j, cellsize, cellsize)
            }
        }
    }

    canvas.fillStyle = '#586E75'
    canvas.fill()

    canvas.fillStyle = '#FFFBEB'
    paintPattern()


    canvas.beginPath()

    level.p.concat(level.w)
    .forEach(function (platform) {
        canvas.moveTo(platform[0].x, platform[0].y)
        canvas.lineTo(platform[1].x, platform[1].y)
    })

    canvas.lineCap = 'square'
    canvas.lineWidth = 2
    canvas.strokeStyle = '#EEFF41'
    canvas.stroke()
}

function paintPattern() {
    var step = 20, pad = 10
    var thickness = 2, inc = 0.000626
    var a = Math.random() < 0.5? -0.1: 0.1
    var i, j

    if (Math.random() < 0.5) {
        thickness = 4
        inc = -inc
    }

    canvas.save()

    canvas.translate(0.5 * cwidth, 0.5 * cheight)
    canvas.rotate(Math.random() < 0.5? 0.5 * a: a)
    canvas.translate(-0.5 * cwidth, -0.5 * cheight)

    canvas.globalCompositeOperation = 'source-atop'

    for (i = -pad; i < cwidth / step + pad; ++i) {
        for (j = -pad; j < cheight / step + pad; ++j) {
            canvas.beginPath()
            canvas.arc((i + 0.5) * step, (j + 0.5) * step, thickness += inc, 0, 2 * Math.PI)
            canvas.fill()
        }
    }

    canvas.restore()
}


paintLevel(levels[0])
{'fraction_non_alphanumeric': 0.16734879490677582, 'fraction_numerical': 0.03319690768531151, 'mean_word_length': 1.9769959404600812, 'pattern_counts': {'":': 0, '<': 8, '<?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': '4053169', 'n_tokens_mistral': 850, 'n_tokens_neox': 788, 'n_words': 164}