<commit_before>#
# This loads the configuration
#
import ConfigParser
import os
config = ConfigParser.ConfigParser()

user_file = os.path.join(os.getenv('HOME'),'.gpy_config.cfg')
default_file = os.path.join('..','gpy_config.cfg')

# 1. check if the user has a ~/.gpy_config.cfg
if os.path.isfile(user_file):
    config.read(user_file)
else:
    # 2. if not, use the default one
    path = os.path.dirname(__file__)
    config.read(os.path.join(path,default_file))<commit_msg>changed how we search for config files on windows<commit_after>#
# This loads the configuration
#
import ConfigParser
import os
config = ConfigParser.ConfigParser()

home = os.getenv('HOME') or os.getenv('USERPROFILE')
user_file = os.path.join(home,'.gpy_config.cfg')
default_file = os.path.join('..','gpy_config.cfg')

# 1. check if the user has a ~/.gpy_config.cfg
if os.path.isfile(user_file):
    config.read(user_file)
else:
    # 2. if not, use the default one
    path = os.path.dirname(__file__)
    config.read(os.path.join(path,default_file))
{'fraction_non_alphanumeric': 0.14007782101167315, 'fraction_numerical': 0.0038910505836575876, 'mean_word_length': 4.502673796791444, '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': '6493968', 'n_tokens_mistral': 362, 'n_tokens_neox': 357, 'n_words': 85}