<commit_before>import smtplib
import re
import logging
from email.mime.text import MIMEText

try:
    import simplejson as json
except ImportError:
    import json

with open("mailer.json") as f:
    mailer = json.load(f)


def get_color_based_on_severity(severity):
    if severity.lower() == 'fatal':
        return 'red'
    if severity.lower() == 'warning':
        return 'yellow'
    return 'green'


def get_html_name(name):
    return re.sub("\s+", "_", name)


def format_item(item):
    return """
    <p>
      <table width='100%' border=0 cellpadding=12 cellspacing=0 name="{3}">
        <tr style='background-color:{1}'>
          <td align='center' style='font-size:18px;border:0'><b>{0}</b></td>
          <td style='width: 5%'><a href="#toc">Top</a></td>
        </tr>
        <tr>
          <td style='border:0'><pre>{2}</pre></td>
        </tr>
      </table>
    </p>
    """.format(
        item["title"],
        get_color_based_on_severity(item["severity"]),
        item["body"],
        get_html_name(item["title"])
    )


def build_toc(content):<commit_msg>let the body of sections span over two columns<commit_after>import smtplib
import re
import logging
from email.mime.text import MIMEText

try:
    import simplejson as json
except ImportError:
    import json

with open("mailer.json") as f:
    mailer = json.load(f)


def get_color_based_on_severity(severity):
    if severity.lower() == 'fatal':
        return 'red'
    if severity.lower() == 'warning':
        return 'yellow'
    return 'green'


def get_html_name(name):
    return re.sub("\s+", "_", name)


def format_item(item):
    return """
    <p>
      <table width='100%' border=0 cellpadding=12 cellspacing=0 name="{3}">
        <tr style='background-color:{1}'>
          <td align='center' style='font-size:18px;border:0'><b>{0}</b></td>
          <td style='width: 5%'><a href="#toc">Top</a></td>
        </tr>
        <tr>
          <td style='border:0' colspan='2' align='center'><pre>{2}</pre></td>
        </tr>
      </table>
    </p>
    """.format(
        item["title"],
        get_color_based_on_severity(item["severity"]),
        item["body"],
        get_html_name(item["title"])
    )


def build_toc(content):
{'fraction_non_alphanumeric': 0.1734052111410602, 'fraction_numerical': 0.014824797843665768, 'mean_word_length': 2.8596187175043326, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '4494902', 'n_tokens_mistral': 800, 'n_tokens_neox': 758, 'n_words': 163}