<commit_before>from pony.main import *
from pony import utils
from pony.logging import search_log

import pprint, threading, time
from datetime import timedelta
from pony.templating import html, template

@http('/pony/test')
def test():
    return html('''
    <h1>Content of request headers</h1>
    <table border="1">
    <tr><th>Header</th><th>Value</th></tr>
    $for(key, value in sorted(get_request().environ.items())){
    <tr><td>$key</td><td>&nbsp;$value</td></tr>
    }
    </table>''')

MAX_RECORD_DISPLAY_COUNT = 1000

@http('/getLastRecords')
def feed():
    data = load()
    records_count = len(data)
    return template("""
    {"recordsReturned":$records_count,"records":[
        $for(r in data) {          <commit_msg>Import from pony.main was removed<commit_after>import pprint, threading, time
from datetime import timedelta

from pony import utils
from pony.web import http
from pony.logging import search_log

from pony.templating import html, template

@http('/pony/test')
def test():
    return html('''
    <h1>Content of request headers</h1>
    <table border="1">
    <tr><th>Header</th><th>Value</th></tr>
    $for(key, value in sorted(get_request().environ.items())){
    <tr><td>$key</td><td>&nbsp;$value</td></tr>
    }
    </table>''')

MAX_RECORD_DISPLAY_COUNT = 1000

@http('/getLastRecords')
def feed():
    data = load()
    records_count = len(data)
    return template("""
    {"recordsReturned":$records_count,"records":[
        $for(r in data) {          
{'fraction_non_alphanumeric': 0.16432865731462926, 'fraction_numerical': 0.009352037408149633, 'mean_word_length': 3.943894389438944, 'pattern_counts': {'":': 4, '<': 35, '<?xml version=': 0, '>': 35, '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': '6494831', 'n_tokens_mistral': 513, 'n_tokens_neox': 493, 'n_words': 119}