<commit_before>from py2js.decorator import JavaScript, JSVar

@JavaScript()
@JSVar("window", "alert")
def StartGoL():
    window.gol = GoL()

@JavaScript()
class GoL(object):

    @JSVar("document", "Math", "setInterval", "self.canvas")
    def __init__(self):
        self.width = 75
        self.height = 75
        self.canvas = document.getElementById('canvas').getContext('2d')
        self.canvas.fillStyle = 'rgb(0, 0, 0)'
        self.grid = list(range(self.width*self.height))
        for i in range(self.width*self.height):
            self.grid[i] = Random() > 0.5
        setInterval('window.gol.iter()', 25)
        self.draw()

    def get(self, x, y):
        return self.grid[((x + self.width) % self.width) + ((y + self.height) % self.height) * self.width]

    def iter(self):
        toDie = []
        toLive = []
        for x in range(0, self.width):
            for y in range(0, self.height):
                count = 0
                if self.get(x-1, y-1):
                    count += 1
                if self.get(x, y-1):
                    count += 1
                if self.get(x+1, y-1):
                    count += 1
                if self.get(x-1, y):<commit_msg> * Updated example code for new compiler syntax<commit_after>from py2js.decorator import JavaScript, JSVar

@JavaScript()
@JSVar("window", "alert")
def StartGoL():
    window.gol = GoL()

@JavaScript()
class GoL(object):

    @JSVar("document", "Math", "setInterval", "self.canvas")
    def __init__(self):
        self.width = 75
        self.height = 75
        self.canvas = document.getElementById('canvas').getContext('2d')
        self.canvas.fillStyle = 'rgb(0, 0, 0)'
        self.grid = list(range(self.width*self.height))
        for i in range(self.width*self.height):
            self.grid[i] = Random() > 0.5

        setInterval('window.gol.iter.__call__.call(window.gol)', 250)
        self.draw()

    def get(self, x, y):
        return self.grid[((x + self.width) % self.width) + ((y + self.height) % self.height) * self.width]

    def iter(self):
        toDie = []
        toLive = []
        for x in range(0, self.width):
            for y in range(0, self.height):
                count = 0
                if self.get(x-1, y-1):
                    count += 1
                if self.get(x, y-1):
                    count += 1
                if self.get(x+1, y-1):
                    count += 1
                if self.get(x-1, y):
{'fraction_non_alphanumeric': 0.1529698942229455, 'fraction_numerical': 0.020748576078112285, 'mean_word_length': 1.8038768529076397, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2305531', 'n_tokens_mistral': 826, 'n_tokens_neox': 774, 'n_words': 184}