<commit_before>import os
import logging, unittest
import yaml

config = {}
def load_yaml(path):
    logging.info('Reading yaml from <{0}>'.format(path))
    with open(path) as file:
        raw_yaml = file.read()
    return yaml.load(raw_yaml)

def load_db_config(db_type):
    if db_type == 'couchdb':
        server = os.environ.get('CLOUDANT_URL',None)
        return = {
                'server': server if server else 'http://127.0.0.1:5984',
                'username': '',
                'password': '',
            }
    
def load_config():
    global config
    if not config:
        path = os.path.join(os.getcwd(), 'config.yaml')
        config = load_yaml(path)
        load_db_config('couchdb')
    return config
    
def iter_txt(file_name):
    path = os.path.join(os.getcwd(),file_name)
    logging.info('Reading txt from <{0}>'.format(path))<commit_msg>fix typo<commit_after>import os
import logging, unittest
import yaml

config = {}
def load_yaml(path):
    logging.info('Reading yaml from <{0}>'.format(path))
    with open(path) as file:
        raw_yaml = file.read()
    return yaml.load(raw_yaml)

def load_db_config(db_type):
    if db_type == 'couchdb':
        server = os.environ.get('CLOUDANT_URL',None)
        return {
                'server': server if server else 'http://127.0.0.1:5984',
                'username': '',
                'password': '',
            }
    
def load_config():
    global config
    if not config:
        path = os.path.join(os.getcwd(), 'config.yaml')
        config = load_yaml(path)
        load_db_config('couchdb')
    return config
    
def iter_txt(file_name):
    path = os.path.join(os.getcwd(),file_name)
    logging.info('Reading txt from <{0}>'.format(path))
{'fraction_non_alphanumeric': 0.14104778353483016, 'fraction_numerical': 0.013816925734024179, 'mean_word_length': 2.4829659318637276, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3444497', 'n_tokens_mistral': 590, 'n_tokens_neox': 569, 'n_words': 122}