<commit_before>from browser import ajax

def show(req, expect):
    text = req.text
    if expect not in text:
      print(req.responseURL, expect, 'not in', text)
      print(text.encode('latin-1'))

# ajax.get to read text files
ajax.get("files/text-utf8.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'bébé'))

ajax.get("files/text-utf8.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'bébé'),
    blocking=True)

ajax.get("../doc/en/cookbook/file.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'Шея'))

ajax.get("../doc/en/cookbook/file.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'Шея'),
    blocking=True)

# other encodings
ajax.get("files/text-latin1.txt", encoding='latin-1',
    oncomplete=lambda req: show(req, 'bébé'))
<commit_msg>Change urls in test_ajax.py<commit_after>from browser import ajax

def show(req, expect):
    text = req.text
    if expect not in text:
      print(req.responseURL, expect, 'not in', text)
      print(text.encode('latin-1'))

# ajax.get to read text files
ajax.get("files/text-utf8.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'bébé'))

ajax.get("files/text-utf8.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'bébé'),
    blocking=True)

ajax.get("../static_doc/en/cookbook/file.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'Шея'))

ajax.get("../static_doc/en/cookbook/file.txt", encoding='utf-8',
    oncomplete=lambda req: show(req, 'Шея'),
    blocking=True)

# other encodings
ajax.get("files/text-latin1.txt", encoding='latin-1',
    oncomplete=lambda req: show(req, 'bébé'))

{'fraction_non_alphanumeric': 0.17975460122699385, 'fraction_numerical': 0.011042944785276074, 'mean_word_length': 4.210862619808307, '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': '4001794', 'n_tokens_mistral': 607, 'n_tokens_neox': 606, 'n_words': 121}