<commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
try:
    from gevent import monkey
    from gevent_zeromq import monkey_patch
    monkey.patch_all()
    monkey_patch()
except ImportError:
    pass

import logging
import os
from ConfigParser import NoSectionError
from collections import defaultdict

from tokenserver.assignment import INodeAssignment
from tokenserver.util import hook_metlog_handler

from mozsvc.config import get_configurator
from mozsvc.plugin import load_and_register, load_from_settings
from mozsvc.secrets import Secrets


logger = logging.getLogger('tokenserver')


def includeme(config):
    config.include("cornice")
    config.include("mozsvc")
    config.scan("tokenserver.views")<commit_msg>moved the gevent/gevent_zmq monkey patching to includeme() so only the pyramid app is impacted by this, not the crypto workers<commit_after># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import logging
import os
from ConfigParser import NoSectionError
from collections import defaultdict

from tokenserver.assignment import INodeAssignment
from tokenserver.util import hook_metlog_handler

from mozsvc.config import get_configurator
from mozsvc.plugin import load_and_register, load_from_settings
from mozsvc.secrets import Secrets


logger = logging.getLogger('tokenserver')


def includeme(config):
    try:
        from gevent import monkey
        from gevent_zeromq import monkey_patch
        monkey.patch_all()
        monkey_patch()
    except ImportError:
        pass

    config.include("cornice")
    config.include("mozsvc")
    config.scan("tokenserver.views")
{'fraction_non_alphanumeric': 0.06279434850863422, 'fraction_numerical': 0.004186289900575615, 'mean_word_length': 4.4164305949008495, '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': '7452122', 'n_tokens_mistral': 568, 'n_tokens_neox': 544, 'n_words': 196}