<commit_before># -*- coding: utf-8 -*-

# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END

import signal
import asyncio
from aiohttp import web

from foglamp.core import routes
from foglamp.core import middleware
from foglamp.core import scheduler

__author__ = "<NAME>"
__copyright__ = "Copyright (c) 2017 OSIsoft, LLC"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"


def _make_app():
    """create the server"""
    # https://aiohttp.readthedocs.io/en/stable/_modules/aiohttp/web.html#run_app
    app = web.Application(middlewares=[middleware.error_middleware])
    routes.setup(app)
    return app


def _shutdown(loop):
    scheduler.shutdown()
    for task in asyncio.Task.all_tasks():
        task.cancel()
    loop.stop()


def start():
    """starts the server"""
    loop = asyncio.get_event_loop()
    scheduler.start(loop)

    for signal_name in (signal.SIGINT, signal.SIGTERM, signal.SIGQUIT):
        loop.add_signal_handler(signal_name, _shutdown, loop)

    web.run_app(_make_app(), host='0.0.0.0', port=8082)

<commit_msg>Remove loop parameter from scheduler.start()<commit_after># -*- coding: utf-8 -*-

# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END

import signal
import asyncio
from aiohttp import web

from foglamp.core import routes
from foglamp.core import middleware
from foglamp.core import scheduler

__author__ = "<NAME>"
__copyright__ = "Copyright (c) 2017 OSIsoft, LLC"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"


def _make_app():
    """create the server"""
    # https://aiohttp.readthedocs.io/en/stable/_modules/aiohttp/web.html#run_app
    app = web.Application(middlewares=[middleware.error_middleware])
    routes.setup(app)
    return app


def _shutdown(loop):
    scheduler.shutdown()
    for task in asyncio.Task.all_tasks():
        task.cancel()
    loop.stop()


def start():
    """starts the server"""
    loop = asyncio.get_event_loop()
    scheduler.start()

    for signal_name in (signal.SIGINT, signal.SIGTERM, signal.SIGQUIT):
        loop.add_signal_handler(signal_name, _shutdown, loop)

    web.run_app(_make_app(), host='0.0.0.0', port=8082)


{'fraction_non_alphanumeric': 0.13027352804821513, 'fraction_numerical': 0.013908205841446454, 'mean_word_length': 3.94954128440367, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '7466530', 'n_tokens_mistral': 781, 'n_tokens_neox': 749, 'n_words': 164}