<commit_before># -*- coding: utf-8 -*-

from base import *
import random
import time
from bnw.core.base import BnwResponse, get_webui_base
import bnw.core.bnw_objects as objs
from bnw.core.post import publish

from twisted.python import log
import bnw.core.post
from throttle import throttle_check

def _(s, user):
    return s

acceptable_formats = ["markdown", "md", "moinmoin", "mm", "plaintext"]
acceptable_formats_str = u", ".join(acceptable_formats)

def normalize_format(format):
    """Turns common shortenings into full format names."""
    if format is "md":
        format = "markdown"
    elif format is "mm":
        format = "moinmoin"

    return format

@defer.inlineCallbacks
def postMessage(request, tags, clubs, text, anon=False, anoncomments=False,
                format=None):
        yield throttle_check(request.user['name'])
        sfrom = request.to.userhost() if request.to else None
        start = text[:10].lower()
        if start.startswith('?otr'):<commit_msg>Compare strings properly<commit_after># -*- coding: utf-8 -*-

from base import *
import random
import time
from bnw.core.base import BnwResponse, get_webui_base
import bnw.core.bnw_objects as objs
from bnw.core.post import publish

from twisted.python import log
import bnw.core.post
from throttle import throttle_check

def _(s, user):
    return s

acceptable_formats = ["markdown", "md", "moinmoin", "mm", "plaintext"]
acceptable_formats_str = u", ".join(acceptable_formats)

def normalize_format(fmt):
    """Turns common shortenings into full format names."""
    if fmt == u"md":
        fmt = "markdown"
    elif fmt == u"mm":
        fmt = "moinmoin"

    return fmt

@defer.inlineCallbacks
def postMessage(request, tags, clubs, text, anon=False, anoncomments=False,
                format=None):
        yield throttle_check(request.user['name'])
        sfrom = request.to.userhost() if request.to else None
        start = text[:10].lower()
        if start.startswith('?otr'):
{'fraction_non_alphanumeric': 0.11699445284921836, 'fraction_numerical': 0.0030257186081694403, 'mean_word_length': 3.624708624708625, 'pattern_counts': {'":': 4, '<': 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': '5689990', 'n_tokens_mistral': 649, 'n_tokens_neox': 606, 'n_words': 181}