<commit_before>"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  This file is part of the Smart Developer Hub Project:
    http://www.smartdeveloperhub.org

  Center for Open Middleware
        http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  Copyright (C) 2015 Center for Open Middleware.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  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.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
"""
from redis.exceptions import RedisError, BusyLoadingError

__author__ = '<NAME>'

import redis
import agora.fountain.vocab.schema as sch
from agora.fountain.exceptions import FountainError
import agora.fountain.vocab.onto as vocs
from datetime import datetime as dt
from concurrent.futures.thread import ThreadPoolExecutor
import logging
from agora.fountain.server import app
import sys


log = logging.getLogger('agora.fountain.index')

redis_conf = app.config['REDIS']
pool = redis.ConnectionPool(host=redis_conf.get('host'), port=6379, db=redis_conf.get('db'))
r = redis.StrictRedis(connection_pool=pool)
tpool = ThreadPoolExecutor(20)

# Ping redis to check if it's ready
requests = 0
while True:
    try:
        r.keys('*')<commit_msg>Redis port in service config class<commit_after>"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  This file is part of the Smart Developer Hub Project:
    http://www.smartdeveloperhub.org

  Center for Open Middleware
        http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  Copyright (C) 2015 Center for Open Middleware.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
  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.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
"""
from redis.exceptions import RedisError, BusyLoadingError

__author__ = '<NAME>'

import redis
import agora.fountain.vocab.schema as sch
from agora.fountain.exceptions import FountainError
import agora.fountain.vocab.onto as vocs
from datetime import datetime as dt
from concurrent.futures.thread import ThreadPoolExecutor
import logging
from agora.fountain.server import app
import sys


log = logging.getLogger('agora.fountain.index')

redis_conf = app.config['REDIS']
pool = redis.ConnectionPool(host=redis_conf.get('host'), port=redis_conf.get('port'), db=redis_conf.get('db'))
r = redis.StrictRedis(connection_pool=pool)
tpool = ThreadPoolExecutor(20)

# Ping redis to check if it's ready
requests = 0
while True:
    try:
        r.keys('*')
{'fraction_non_alphanumeric': 0.22919472124966334, 'fraction_numerical': 0.007002423915970913, 'mean_word_length': 3.2156640181611804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6246462', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1056, 'n_words': 336}