<commit_before>#!/usr/bin/env python

from __future__ import print_function
import sys, re, os.path, cgi, stat, math
from optparse import OptionParser
from color import getColorizer, dummyColorizer

class tblCell(object):
    def __init__(self, text, value = None, props = None):
        self.text = text
        self.value = value
        self.props = props

class tblColumn(object):
    def __init__(self, caption, title = None, props = None):
        self.text = caption
        self.title = title
        self.props = props

class tblRow(object):
    def __init__(self, colsNum, props = None):
        self.cells = [None] * colsNum
        self.props = props

def htmlEncode(str):
    return '<br/>'.join([cgi.escape(s) for s in str])
<commit_msg>ts: migrate from cgi.escape to html.escape in .py file<commit_after>#!/usr/bin/env python

from __future__ import print_function
import sys, re, os.path, stat, math
try:
    from html import escape
except ImportError:
    from cgi import escape  # Python 2.7
from optparse import OptionParser
from color import getColorizer, dummyColorizer

class tblCell(object):
    def __init__(self, text, value = None, props = None):
        self.text = text
        self.value = value
        self.props = props

class tblColumn(object):
    def __init__(self, caption, title = None, props = None):
        self.text = caption
        self.title = title
        self.props = props

class tblRow(object):
    def __init__(self, colsNum, props = None):
        self.cells = [None] * colsNum
        self.props = props

def htmlEncode(str):
    return '<br/>'.join([escape(s) for s in str])

{'fraction_non_alphanumeric': 0.10319410319410319, 'fraction_numerical': 0.0012285012285012285, 'mean_word_length': 3.0123152709359604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5506205', 'n_tokens_mistral': 509, 'n_tokens_neox': 491, 'n_words': 164}