<commit_before># requires https://pypi.python.org/pypi/websocket-client/
from excepthook import uncaught_exception, install_thread_excepthook
import websocket
import getpass
from threading import Thread
import traceback
from bodyfetcher import BodyFetcher
from chatcommunicate import watcher
from continuousintegration import watch_ci
from datetime import datetime
import sys
from utcdate import UtcDate
from spamhandling import check_if_spam_json, handle_spam_json
from globalvars import GlobalVars
from datahandling import load_files, filter_auto_ignored_posts
import os
import time
import requests

# !! Important! Be careful when adding code before this point.
# Our except hook will be installed here, so any errors before this point
# won't be caught if they're not in a try-except block.
# Hence, please avoid adding code before this comment, but if it's necessary,
# test it thoroughly.

sys.excepthook = uncaught_exception
install_thread_excepthook()

if "ChatExchangeU" in os.environ:
    username = os.environ["ChatExchangeU"]
else:
    print "Username: "
    username = raw_input()
if "ChatExchangeP" in os.environ:
    password = os.environ["ChatExchangeP"]
else:
    password = get<PASSWORD>pass("Password: ")

load_files()
filter_auto_ignored_posts()

GlobalVars.bodyfetcher = BodyFetcher()
GlobalVars.wrap.login(username, password)
GlobalVars.wrapm.login(username, password)
GlobalVars.s = "[ [SmokeDetector](https://github.com/Charcoal-SE/SmokeDetector) ] " \
               "SmokeDetector started at [rev " +\
               GlobalVars.commit_with_author +\
               "](https://github.com/Charcoal-SE/SmokeDetector/commit/" +\
               GlobalVars.commit +\
               ") (hosted by Undo)"
GlobalVars.s_reverted = "[ [SmokeDetector](https://github.com/Charcoal-SE/SmokeDetector) ] " \
                        "SmokeDetector started in [reverted mode](https://github.com/Charcoal-SE/SmokeDetector/blob/master/RevertedMode.md) " \
                        "at [rev " + \
                        GlobalVars.commit_with_author + \
                        "](https://github.com/Charcoal-SE/SmokeDetector/commit/" + \
                        GlobalVars.commit + \
                        ") (hosted by Undo)"
GlobalVars.charcoal_hq = GlobalVars.wrap.get_room(GlobalVars.charcoal_room_id)
tavern_id = GlobalVars.meta_tavern_room_id
GlobalVars.tavern_on_the_meta = GlobalVars.wrapm.get_room(tavern_id)

GlobalVars.specialrooms = [{
                           "sites": ["math.stackexchange.com"],
                           "room": GlobalVars.wrap.get_room("2165"),
                           "unwantedReasons": []
                           }, {
                           "sites": ["english.stackexchange.com"],
                           "room": GlobalVars.wrap.get_room("95"),
                           "unwantedReasons": []
                           }, {
                           "sites": ["askubuntu.com"],
                           "room": GlobalVars.wrap.get_room("201"),
                           "unwantedReasons": ["All-caps title",
                                               "Phone number detected",
                                               "Repeating characters"]
                           }, {
                           "sites": ["puzzling.stackexchange.com"],
                           "room": GlobalVars.wrap.get_room("21276"),<commit_msg>Fix unwanted reasons for AU<commit_after># requires https://pypi.python.org/pypi/websocket-client/
from excepthook import uncaught_exception, install_thread_excepthook
import websocket
import getpass
from threading import Thread
import traceback
from bodyfetcher import BodyFetcher
from chatcommunicate import watcher
from continuousintegration import watch_ci
from datetime import datetime
import sys
from utcdate import UtcDate
from spamhandling import check_if_spam_json, handle_spam_json
from globalvars import GlobalVars
from datahandling import load_files, filter_auto_ignored_posts
import os
import time
import requests

# !! Important! Be careful when adding code before this point.
# Our except hook will be installed here, so any errors before this point
# won't be caught if they're not in a try-except block.
# Hence, please avoid adding code before this comment, but if it's necessary,
# test it thoroughly.

sys.excepthook = uncaught_exception
install_thread_excepthook()

if "ChatExchangeU" in os.environ:
    username = os.environ["ChatExchangeU"]
else:
    print "Username: "
    username = raw_input()
if "ChatExchangeP" in os.environ:
    password = os.environ["ChatExchangeP"]
else:
    password = <PASSWORD>("Password: ")

load_files()
filter_auto_ignored_posts()

GlobalVars.bodyfetcher = BodyFetcher()
GlobalVars.wrap.login(username, password)
GlobalVars.wrapm.login(username, password)
GlobalVars.s = "[ [SmokeDetector](https://github.com/Charcoal-SE/SmokeDetector) ] " \
               "SmokeDetector started at [rev " +\
               GlobalVars.commit_with_author +\
               "](https://github.com/Charcoal-SE/SmokeDetector/commit/" +\
               GlobalVars.commit +\
               ") (hosted by Undo)"
GlobalVars.s_reverted = "[ [SmokeDetector](https://github.com/Charcoal-SE/SmokeDetector) ] " \
                        "SmokeDetector started in [reverted mode](https://github.com/Charcoal-SE/SmokeDetector/blob/master/RevertedMode.md) " \
                        "at [rev " + \
                        GlobalVars.commit_with_author + \
                        "](https://github.com/Charcoal-SE/SmokeDetector/commit/" + \
                        GlobalVars.commit + \
                        ") (hosted by Undo)"
GlobalVars.charcoal_hq = GlobalVars.wrap.get_room(GlobalVars.charcoal_room_id)
tavern_id = GlobalVars.meta_tavern_room_id
GlobalVars.tavern_on_the_meta = GlobalVars.wrapm.get_room(tavern_id)

GlobalVars.specialrooms = [{
                           "sites": ["math.stackexchange.com"],
                           "room": GlobalVars.wrap.get_room("2165"),
                           "unwantedReasons": []
                           }, {
                           "sites": ["english.stackexchange.com"],
                           "room": GlobalVars.wrap.get_room("95"),
                           "unwantedReasons": []
                           }, {
                           "sites": ["askubuntu.com"],
                           "room": GlobalVars.wrap.get_room("201"),
                           "unwantedReasons": ["All-caps title",
                                               "Phone number detected",
                                               "Repeating characters in title",
                                               "Repeating characters in body",
                                               "Repeating characters in answer"]
                           }, {
                           "sites": ["puzzling.stackexchange.com"],
                           "room": GlobalVars.wrap.get_room("21276"),
{'fraction_non_alphanumeric': 0.09842180774748924, 'fraction_numerical': 0.0040172166427546625, 'mean_word_length': 2.0968458462905377, 'pattern_counts': {'":': 22, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4746769', 'n_tokens_mistral': 1937, 'n_tokens_neox': 1900, 'n_words': 409}