<commit_before><!DOCTYPE html> 
<html>
<head>
<meta charset="iso-8859-1">
<link rel="stylesheet" href="../doc/doc_brython.css">

<link rel="stylesheet" href="console.css">

<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script src="ace/mode-python3.js" type="text/javascript" charset="utf-8"></script>
<script src="ace/snippets/python.js" type="text/javascript" charset="utf-8"></script>


<script type="text/javascript" src="../../src/brython_builtins.js"></script>
<script type="text/javascript" src="../../src/version_info.js"></script>
<script type="text/javascript" src="../../src/identifiers_re.js"></script>
<script type="text/javascript" src="../../src/py2js.js"></script>
<script type="text/javascript" src="../../src/py_object.js"></script>
<script type="text/javascript" src="../../src/py_type.js"></script>
<script type="text/javascript" src="../../src/py_utils.js"></script>
<script type="text/javascript" src="../../src/py_generator.js"></script>
<script type="text/javascript" src="../../src/py_builtin_functions.js"></script>
<script type="text/javascript" src="../../src/py_bytes.js"></script>
<script type="text/javascript" src="../../src/py_set.js"></script>
<script type="text/javascript" src="../../src/js_objects.js"></script>
<script type="text/javascript" src="../../src/stdlib_paths.js"></script>
<script type="text/javascript" src="../../src/py_import.js"></script>

<script type="text/javascript" src="../../src/py_string.js"></script>
<script type="text/javascript" src="../../src/py_int.js"></script>
<script type="text/javascript" src="../../src/py_float.js"></script>
<script type="text/javascript" src="../../src/py_complex.js"></script>
<script type="text/javascript" src="../../src/py_dict.js"></script>
<script type="text/javascript" src="../../src/py_list.js"></script>
<script type="text/javascript" src="../../src/py_dom.js"></script>

<script type="text/python" src="editor.py"></script>

<script type="text/python3">
from browser import document as doc
from browser import timer
import time

script_num = -1
failed = []
t_start = None

def test_next():
    global script_num,failed
    script_num += 1
    options = doc['files'].options
    if script_num < len(options):
        option = doc['files'].options[script_num]
        src = open(option.value).read()
        doc['files'].selectedIndex = script_num
        editor.setValue(src)
        state = run(in_globals=True)
        if state == 0:
            failed.append(option.text)
        timer.set_timeout(test_next,500)
    else:
        doc['console'].value = ''
        print('completed all tests in %.2f s' %(time.time()-t_start))
        print('failed : %s' %failed)
    
def test_all(ev):
    global script_num,failed,t_start
    script_num = -1
    t_start = time.time()
    failed = []
    test_next()

def set_debug(ev):
    if ev.target.checked:
        __BRYTHON__.debug = 1
    else:
        __BRYTHON__.debug = 0

# bindings
doc['test_all'].bind('click',test_all)
doc['set_debug'].bind('change',set_debug)<commit_msg>Set debug mode in site/tests/index.html<commit_after><!DOCTYPE html> 
<html>
<head>
<meta charset="iso-8859-1">
<link rel="stylesheet" href="../doc/doc_brython.css">

<link rel="stylesheet" href="console.css">

<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script src="ace/mode-python3.js" type="text/javascript" charset="utf-8"></script>
<script src="ace/snippets/python.js" type="text/javascript" charset="utf-8"></script>


<script type="text/javascript" src="../../src/brython_builtins.js"></script>
<script type="text/javascript" src="../../src/version_info.js"></script>
<script type="text/javascript" src="../../src/identifiers_re.js"></script>
<script type="text/javascript" src="../../src/py2js.js"></script>
<script type="text/javascript" src="../../src/py_object.js"></script>
<script type="text/javascript" src="../../src/py_type.js"></script>
<script type="text/javascript" src="../../src/py_utils.js"></script>
<script type="text/javascript" src="../../src/py_generator.js"></script>
<script type="text/javascript" src="../../src/py_builtin_functions.js"></script>
<script type="text/javascript" src="../../src/py_bytes.js"></script>
<script type="text/javascript" src="../../src/py_set.js"></script>
<script type="text/javascript" src="../../src/js_objects.js"></script>
<script type="text/javascript" src="../../src/stdlib_paths.js"></script>
<script type="text/javascript" src="../../src/py_import.js"></script>

<script type="text/javascript" src="../../src/py_string.js"></script>
<script type="text/javascript" src="../../src/py_int.js"></script>
<script type="text/javascript" src="../../src/py_float.js"></script>
<script type="text/javascript" src="../../src/py_complex.js"></script>
<script type="text/javascript" src="../../src/py_dict.js"></script>
<script type="text/javascript" src="../../src/py_list.js"></script>
<script type="text/javascript" src="../../src/py_dom.js"></script>

<script type="text/python" src="editor.py"></script>

<script type="text/python3">
from browser import document as doc
from browser import timer
import time

script_num = -1
failed = []
t_start = None

def test_next():
    global script_num,failed
    script_num += 1
    options = doc['files'].options
    if script_num < len(options):
        option = doc['files'].options[script_num]
        src = open(option.value).read()
        doc['files'].selectedIndex = script_num
        editor.setValue(src)
        state = run(in_globals=True)
        if state == 0:
            failed.append(option.text)
        timer.set_timeout(test_next,500)
    else:
        doc['console'].value = ''
        print('completed all tests in %.2f s' %(time.time()-t_start))
        print('failed : %s' %failed)
    
def test_all(ev):
    global script_num,failed,t_start
    script_num = -1
    t_start = time.time()
    failed = []
    test_next()

def set_debug(ev):
    if ev.target.checked:
        __BRYTHON__.debug = 1
    else:
        __BRYTHON__.debug = 0

__BRYTHON__.debug = int(doc['set_debug'].checked)
# bindings
doc['test_all'].bind('click',test_all)
doc['set_debug'].bind('change',set_debug)
{'fraction_non_alphanumeric': 0.2190446260213702, 'fraction_numerical': 0.0069138906348208675, 'mean_word_length': 3.9765441751368256, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 121, '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': '2319837', 'n_tokens_mistral': 2066, 'n_tokens_neox': 2026, 'n_words': 349}