<commit_before>import web

from mazegen import GrowingTree
from renderer import render_live_html
urls =(
    '/','generate'
)

from sys import setrecursionlimit
setrecursionlimit(2000)
class generate:
    def generate(self):
        inputs = web.input()
        if 'size' in inputs.keys():
            size = int(inputs.size)
        else:
            size = 15
        maze = GrowingTree(size=size)
        maze.generate_maze()
        return render_live_html(maze=maze)


    def POST(self):
        return self.generate()
<commit_msg>Making sure the 'size' CGI argument is below a maximum value.<commit_after>import web

from mazegen import GrowingTree
from renderer import render_live_html
urls =(
    '/','generate'
)

from sys import setrecursionlimit
setrecursionlimit(2000)
class generate:
    def generate(self):
        inputs = web.input()
        if 'size' in inputs.keys():
            size = min(44, int(inputs.size))
        else:
            size = 15
        maze = GrowingTree(size=size)
        maze.generate_maze()
        return render_live_html(maze=maze)


    def POST(self):
        return self.generate()

{'fraction_non_alphanumeric': 0.09372236958443855, 'fraction_numerical': 0.01237842617152962, 'mean_word_length': 2.639871382636656, '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': '2504934', 'n_tokens_mistral': 362, 'n_tokens_neox': 341, 'n_words': 93}