<commit_before>#!/usr/bin/env python

from twisted.python import log
from twisted.internet import reactor

from core.factory import FuNetwork
from core.protocol import FuProtocol
from core.fubot import Fubot

import json
import argparse

DEFAULT_SETTINGS = 'settings.json'

parser = argparse.ArgumentParser(prog='Fubot')

parser.add_argument('-c', '--config', dest='conffile',
                    help='The configuration file to use',
                    metavar='config_file',
                    action='store', default=DEFAULT_SETTINGS)


if __name__ == '__main__':
    args = parser.parse_args()

    conffile = args.conffile

    with open(conffile) as fd:
        config = json.load(fd)

    name = config.get('logfile', None)

    if name:
        if name == 'stdout':
            import sys
            log.startLogging(sys.stdout)
        else:
            log.startLogging(open(name, 'r'))

    fubot = Fubot(reactor, conffile, config)
    reactor.callWhenRunning(fubot.start)
    reactor.run()
<commit_msg>Some changes to make pylint happier<commit_after>#!/usr/bin/env python

from twisted.python import log
from twisted.internet import reactor

from core.fubot import Fubot

import json
import argparse

DEFAULT_SETTINGS = 'settings.json'

PARSER = argparse.ArgumentParser(prog='Fubot')

PARSER.add_argument('-c', '--config', dest='conffile',
                    help='The configuration file to use',
                    metavar='config_file',
                    action='store', default=DEFAULT_SETTINGS)

def main():
    """Load the config file and start everything"""
    args = PARSER.parse_args()
    conffile = args.conffile

    with open(conffile) as fdes:
        config = json.load(fdes)

    name = config.get('logfile', None)

    if name:
        if name == 'stdout':
            import sys
            log.startLogging(sys.stdout)
        else:
            log.startLogging(open(name, 'r'))

    fubot = Fubot(reactor, conffile, config)
    reactor.callWhenRunning(fubot.start)
    reactor.addSystemEventTrigger('before', 'shutdown', fubot.shutdown)
    reactor.run()

if __name__ == '__main__':
    main()

{'fraction_non_alphanumeric': 0.11105904404873478, 'fraction_numerical': 0.0, 'mean_word_length': 2.7720848056537104, 'pattern_counts': {'":': 0, '<': 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': '28032', 'n_tokens_mistral': 679, 'n_tokens_neox': 648, 'n_words': 158}