<commit_before><commit_msg>game of life from hack day - cute use of scipy features which I just want to remember<commit_after>import numpy as np
import scipy.ndimage as ndimage

def test_func(values):
    return values.sum()

class game:
    def __init__(self):
        self.board = np.zeros((10,10),np.uint)

    def __next_iteration__(self):
        footprint = np.array([[1,1,1],[1,0,1],[1,1,1]])

        alive_neigbhours = ndimage.generic_filter(self.board, test_func, footprint=footprint)
        alive = np.where(self.board == 1 & (alive_neigbhours == 3) | (alive_neigbhours == 2))
        born = np.where(self.board == 0 & (alive_neigbhours == 3))

        self.board = np.zeros((10,10),np.uint)
        self.board[alive] = 1
        self.board[born] = 1
{'fraction_non_alphanumeric': 0.13910761154855644, 'fraction_numerical': 0.031496062992125984, 'mean_word_length': 3.335227272727273, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1800570', 'n_tokens_mistral': 285, 'n_tokens_neox': 272, 'n_words': 60}