<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import logging
import argparse

logging.basicConfig(format='%(levelname)s:%(module)s:%(message)s', level=logging.ERROR)

def webserver(args):
    from core.web import webapp
    webapp.debug = args.debug
    syncdb()
    print "[+] Yeti started. Point browser to http://localhost:5000/{}".format(" (debug)" if args.debug else "")
    webapp.run(host="0.0.0.0")

def syncdb(args=None):
    from core.internals import Internals
    Internals.syncdb()

COMMANDS = {
 'webserver': webserver,
 'syncdb': syncdb,
}

def main():
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers(help='sub-command help', dest="command")

    webserver = subparsers.add_parser('webserver', help='Launch yeti webserver')
    webserver.add_argument('--debug', action='store_true', help="Run Flask in debug mode")

    syncdb = subparsers.add_parser('syncdb', help='Sync database with Yeti version')

    args = parser.parse_args()
    command = args.command
    COMMANDS[command](args)

if __name__ == '__main__':
    main()<commit_msg>autoreload template when in debug mode<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import logging
import argparse

logging.basicConfig(format='%(levelname)s:%(module)s:%(message)s', level=logging.ERROR)


def webserver(args):
    from core.web import webapp

    # Enable debug and autoreload in dev
    webapp.debug = args.debug
    if webapp.debug:
        webapp.config['TEMPLATES_AUTO_RELOAD'] = True

    syncdb()
    print "[+] Yeti started. Point browser to http://localhost:5000/{}".format(" (debug)" if args.debug else "")
    webapp.run(host="0.0.0.0")


def syncdb(args=None):
    from core.internals import Internals
    Internals.syncdb()

COMMANDS = {
    'webserver': webserver,
    'syncdb': syncdb,
}


def main():
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers(help='sub-command help', dest="command")

    webserver = subparsers.add_parser('webserver', help='Launch yeti webserver')
    webserver.add_argument('--debug', action='store_true', help="Run Flask in debug mode")

    subparsers.add_parser('syncdb', help='Sync database with Yeti version')

    args = parser.parse_args()
    command = args.command
    COMMANDS[command](args)

if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.1469457496796241, 'fraction_numerical': 0.007689021785561726, 'mean_word_length': 4.147252747252748, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5943179', 'n_tokens_mistral': 780, 'n_tokens_neox': 770, 'n_words': 171}