<commit_before># world.py: global state variables go here

from collections import defaultdict
import threading
import subprocess

# Global variable to indicate whether we're being ran directly, or imported
# for a testcase.
testing = True

global bot_commands, command_hooks
# This should be a mapping of command names to functions
bot_commands = defaultdict(list)
command_hooks = defaultdict(list)
networkobjects = {}
schedulers = {}
plugins = []
whois_handlers = []
started = threading.Event()

version = "<unknown>"
source = "https://github.com/GLolol/PyLink"  # CHANGE THIS IF YOU'RE FORKING!!

# Only run this once.
if version == "<unknown>":
    # Get version from Git tags.
    try:
        version = 'v' + subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
    except:
        log.exception('Failed to get version from "git describe --tags".')<commit_msg>world: fix 0f26848 (we can't use log here)<commit_after># world.py: global state variables go here

from collections import defaultdict
import threading
import subprocess

# Global variable to indicate whether we're being ran directly, or imported
# for a testcase.
testing = True

global bot_commands, command_hooks
# This should be a mapping of command names to functions
bot_commands = defaultdict(list)
command_hooks = defaultdict(list)
networkobjects = {}
schedulers = {}
plugins = []
whois_handlers = []
started = threading.Event()

version = "<unknown>"
source = "https://github.com/GLolol/PyLink"  # CHANGE THIS IF YOU'RE FORKING!!

# Only run this once.
if version == "<unknown>":
    # Get version from Git tags.
    try:
        version = 'v' + subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
    except Exception as e:
        print('ERROR: Failed to get version from "git describe --tags": %s: %s' % (type(e).__name__, e))
{'fraction_non_alphanumeric': 0.12055974165769645, 'fraction_numerical': 0.004305705059203444, 'mean_word_length': 4.341954022988506, 'pattern_counts': {'":': 3, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '2779589', 'n_tokens_mistral': 556, 'n_tokens_neox': 542, 'n_words': 194}