<commit_before># Copyright 2011 VMware, Inc., 2014 A10 Networks
# Copyright 2015 Hewlett Packard Enterprise Development LP
#
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

"""
Routines for configuring Kosmos
"""
import os

from oslo_config import cfg
from oslo_db import options as db_options
from oslo_log import log as logging
import oslo_messaging as messaging

from kosmos._i18n import _, _LI
from kosmos.common import utils
from kosmos import version

LOG = logging.getLogger(__name__)

core_opts = [
    cfg.IPOpt('bind_host', default='0.0.0.0',
              help=_("The host IP to bind to")),
    cfg.PortOpt('bind_port', default=9876,
                help=_("The port to bind to")),
    cfg.StrOpt('host', default=utils.get_hostname(),
               help=_("The hostname Kosmos is running on")),
]

core_cli_opts = []


# Register the configuration options
cfg.CONF.register_opts(core_opts)
cfg.CONF.register_cli_opts(core_cli_opts)

cfg.CONF.register_opts([
    cfg.StrOpt(
        'pybasedir',
        default=os.path.abspath(os.path.join(os.path.dirname(__file__),
                                             '../')),
        help='Directory where the kosmos python module is installed'
    ),
    cfg.StrOpt('state-path', default='/var/lib/kosmos',
               help='Top-level directory for maintaining kosmos\'s state'),
])

# Ensure that the control exchange is set correctly
messaging.set_transport_defaults(control_exchange='kosmos')
_SQL_CONNECTION_DEFAULT = 'sqlite://'
# Update the default QueuePool parameters. These can be tweaked by the
# configuration variables - max_pool_size, max_overflow and pool_timeout
db_options.set_defaults(cfg.CONF,
                        connection=_SQL_CONNECTION_DEFAULT,
                        sqlite_db='', max_pool_size=10,
                        max_overflow=20, pool_timeout=10)

logging.register_options(cfg.CONF)


def init(args):<commit_msg>Remove sqlite_db argument from set_defaults<commit_after># Copyright 2011 VMware, Inc., 2014 A10 Networks
# Copyright 2015 Hewlett Packard Enterprise Development LP
#
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

"""
Routines for configuring Kosmos
"""
import os

from oslo_config import cfg
from oslo_db import options as db_options
from oslo_log import log as logging
import oslo_messaging as messaging

from kosmos._i18n import _, _LI
from kosmos.common import utils
from kosmos import version

LOG = logging.getLogger(__name__)

core_opts = [
    cfg.IPOpt('bind_host', default='0.0.0.0',
              help=_("The host IP to bind to")),
    cfg.PortOpt('bind_port', default=9876,
                help=_("The port to bind to")),
    cfg.StrOpt('host', default=utils.get_hostname(),
               help=_("The hostname Kosmos is running on")),
]

core_cli_opts = []


# Register the configuration options
cfg.CONF.register_opts(core_opts)
cfg.CONF.register_cli_opts(core_cli_opts)

cfg.CONF.register_opts([
    cfg.StrOpt(
        'pybasedir',
        default=os.path.abspath(os.path.join(os.path.dirname(__file__),
                                             '../')),
        help='Directory where the kosmos python module is installed'
    ),
    cfg.StrOpt('state-path', default='/var/lib/kosmos',
               help='Top-level directory for maintaining kosmos\'s state'),
])

# Ensure that the control exchange is set correctly
messaging.set_transport_defaults(control_exchange='kosmos')
_SQL_CONNECTION_DEFAULT = 'sqlite://'
# Update the default QueuePool parameters. These can be tweaked by the
# configuration variables - max_pool_size, max_overflow and pool_timeout
db_options.set_defaults(cfg.CONF,
                        connection=_SQL_CONNECTION_DEFAULT,
                        max_pool_size=10,
                        max_overflow=20,
                        pool_timeout=10)

logging.register_options(cfg.CONF)


def init(args):
{'fraction_non_alphanumeric': 0.08904109589041095, 'fraction_numerical': 0.0136986301369863, 'mean_word_length': 3.165268456375839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '478918', 'n_tokens_mistral': 1451, 'n_tokens_neox': 1392, 'n_words': 450}