<commit_before>from quizfactory import app, conf
from os import path
import argparse

BASEDIR = path.dirname(__file__)


def set_parser():
    parser = argparse.ArgumentParser(description='run site with quizzes')
    parser.add_argument('-q', '--qpath', metavar='QUIZZES_PATH', type=str,
                        default=path.join(BASEDIR, "quizzes"),
                        help='path to quizzes dir')
    parser.add_argument('-f', '--format', metavar='FORMAT', default='xml',
                        help='format of file [now only xml]')
    parser.add_argument('-p', '--port', metavar='PORT', default=8000,
                        type=int, help='Port of server')
    parser.add_argument('-H', '--host', metavar='HOST', default='0.0.0.0',
                        type=str, help='Host of server')

    return parser


def run(args):

    conf.load_conf(args)

    app.debug = True
    app.template_folder = path.join(BASEDIR, "templates")
    app.static_folder = path.join(BASEDIR, "static")
    app.config['SECRET_KEY'] = "Koszmar firemarka"
    app.run(args.host, args.port)

if __name__ == '__main__':
    parser = set_parser()
    args = parser.parse_args()<commit_msg>add debug arg<commit_after>from quizfactory import app, conf
from os import path
import argparse

BASEDIR = path.dirname(__file__)


def set_parser():
    parser = argparse.ArgumentParser(description='run site with quizzes')
    parser.add_argument('-q', '--qpath', metavar='QUIZZES_PATH', type=str,
                        default=path.join(BASEDIR, "quizzes"),
                        help='path to quizzes dir')
    parser.add_argument('-f', '--format', metavar='FORMAT', default='xml',
                        help='format of file [now only xml]')
    parser.add_argument('-p', '--port', metavar='PORT', default=8000,
                        type=int, help='Port of server')
    parser.add_argument('-H', '--host', metavar='HOST', default='0.0.0.0',
                        type=str, help='Host of server')
    parser.add_argument('-d', '--debug', default=False, action='store_const',
                        const=True, help='run in debug mode')

    return parser


def run(args):

    conf.load_conf(args)

    app.debug = args.debug
    app.template_folder = path.join(BASEDIR, "templates")
    app.static_folder = path.join(BASEDIR, "static")
    app.config['SECRET_KEY'] = "Koszmar firemarka"
    app.run(args.host, args.port)

if __name__ == '__main__':
    parser = set_parser()
    args = parser.parse_args()
{'fraction_non_alphanumeric': 0.1482371794871795, 'fraction_numerical': 0.00641025641025641, 'mean_word_length': 2.78907435508346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 2, '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': '3359393', 'n_tokens_mistral': 804, 'n_tokens_neox': 784, 'n_words': 172}