<commit_before>"""Util to work with Slack users message formatting"""
# pylint: disable=fixme,missing-docstring,unused-variable,invalid-name
import re


def wrap_html(text):
    return '||[' + text + ']||'


def raw_text(s):
    return s.replace('<', '&#60;')


def use_entities(s):
    return s.replace('<', '&lt;').replace('>', '&gt;')


def restore_html(m):
    return m.group(1).replace('&lt;', '<').replace('&gt;', '>')

HTML_RE = re.compile(r'\|\|\[(.+?)\]\|\|', re.MULTILINE | re.DOTALL)
LINK_RE = re.compile(r'\B<([^|>]+)\|?([^|>]+)?>\B')
BOLD_RE = re.compile(r'\B\*(.+?)\*\B')
ITAL_RE = re.compile(r'\b_(.+?)_\b')
STRK_RE = re.compile(r'\B~(.+?)~\B')
PREF_RE = re.compile(r'\B```(.+?)```\B[\n]?', re.MULTILINE | re.DOTALL)
CODE_RE = re.compile(r'\B`(.+?)`\B')
QUOT_RE = re.compile(r'^>\s*(.+?)$[\n]?', re.MULTILINE)
LNGQ_RE = re.compile(r'>>>\s*(.+)[\n]*', re.MULTILINE | re.DOTALL)
MULQ_RE = re.compile(re.escape(wrap_html('</blockquote>')) +
                     re.escape(wrap_html('<blockquote>')), re.MULTILINE)


class Markup(object):
    """Converting markup to HTML"""

    def user_name(self, user):
        return '@'+self.people[user[1:]]['login']

    def stream_name(self, stream):<commit_msg>Show user id for unknown & wrong-formatted users, fix #45<commit_after>"""Util to work with Slack users message formatting"""
# pylint: disable=fixme,missing-docstring,unused-variable,invalid-name
import re


def wrap_html(text):
    return '||[' + text + ']||'


def raw_text(s):
    return s.replace('<', '&#60;')


def use_entities(s):
    return s.replace('<', '&lt;').replace('>', '&gt;')


def restore_html(m):
    return m.group(1).replace('&lt;', '<').replace('&gt;', '>')

HTML_RE = re.compile(r'\|\|\[(.+?)\]\|\|', re.MULTILINE | re.DOTALL)
LINK_RE = re.compile(r'\B<([^|>]+)\|?([^|>]+)?>\B')
BOLD_RE = re.compile(r'\B\*(.+?)\*\B')
ITAL_RE = re.compile(r'\b_(.+?)_\b')
STRK_RE = re.compile(r'\B~(.+?)~\B')
PREF_RE = re.compile(r'\B```(.+?)```\B[\n]?', re.MULTILINE | re.DOTALL)
CODE_RE = re.compile(r'\B`(.+?)`\B')
QUOT_RE = re.compile(r'^>\s*(.+?)$[\n]?', re.MULTILINE)
LNGQ_RE = re.compile(r'>>>\s*(.+)[\n]*', re.MULTILINE | re.DOTALL)
MULQ_RE = re.compile(re.escape(wrap_html('</blockquote>')) +
                     re.escape(wrap_html('<blockquote>')), re.MULTILINE)


class Markup(object):
    """Converting markup to HTML"""

    def user_name(self, user):
        uid = user[1:]
        if uid in self.people:
            return '@'+self.people[uid]['login']
        return user

    def stream_name(self, stream):
{'fraction_non_alphanumeric': 0.2752257557911268, 'fraction_numerical': 0.0039261876717707105, 'mean_word_length': 4.0256410256410255, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 25, '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': '2668835', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1029, 'n_words': 165}