<commit_before>'''utilities.py: worker functions for CREST calls'''

from os import path
import logging
from socket import gethostname, gethostbyname
import smtplib
from datetime import datetime
import time

import pytest

from prosper.common.prosper_config import get_config, get_local_config_filepath

DEFAULT_LOGGER = logging.getLogger('NULL')
DEFAULT_LOGGER.addHandler(logging.NullHandler())

def compare_config_files(config_filepath):
    '''validate that keys in tracked .cfg match keys in _local.cfg'''
    tracked_config = get_config(config_filepath, True)
    local_config = get_config(config_filepath)

    unique_values = {}

    if not path.isfile(get_local_config_filepath(config_filepath)):
        pytest.skip('no local .cfg found, skipping')

    local_unique_sections, local_unique_keys = find_unique_keys(
        local_config,
        tracked_config,
        'local'
    )
    tracked_unique_sections, tracked_unique_keys = find_unique_keys(
        tracked_config,
        local_config,
        'tracked'
    )

    if any([
            local_unique_keys,
            tracked_unique_keys
    ]):
        unique_values['unique_keys'] = {}
        unique_values['unique_keys']['local'] = local_unique_keys
        unique_values['unique_keys']['tracked'] = tracked_unique_keys
    if any([<commit_msg>removing pytest call from prosper_utilities<commit_after>'''utilities.py: worker functions for CREST calls'''

from os import path
import logging
from socket import gethostname, gethostbyname
import smtplib
from datetime import datetime
import time

from prosper.common.prosper_config import get_config, get_local_config_filepath

DEFAULT_LOGGER = logging.getLogger('NULL')
DEFAULT_LOGGER.addHandler(logging.NullHandler())

def compare_config_files(config_filepath):
    '''validate that keys in tracked .cfg match keys in _local.cfg'''
    tracked_config = get_config(config_filepath, True)
    local_config = get_config(config_filepath)

    unique_values = {}

    if not path.isfile(get_local_config_filepath(config_filepath)):
        #pytest.skip('no local .cfg found, skipping')
        return None

    local_unique_sections, local_unique_keys = find_unique_keys(
        local_config,
        tracked_config,
        'local'
    )
    tracked_unique_sections, tracked_unique_keys = find_unique_keys(
        tracked_config,
        local_config,
        'tracked'
    )

    if any([
            local_unique_keys,
            tracked_unique_keys
    ]):
        unique_values['unique_keys'] = {}
        unique_values['unique_keys']['local'] = local_unique_keys
        unique_values['unique_keys']['tracked'] = tracked_unique_keys
    if any([
{'fraction_non_alphanumeric': 0.08270958083832336, 'fraction_numerical': 0.0, 'mean_word_length': 3.86, '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': '5697537', 'n_tokens_mistral': 798, 'n_tokens_neox': 795, 'n_words': 171}