<commit_before>from datetime import datetime
from contextlib import contextmanager
import pickle


@contextmanager
def lazydb(filename):
    # check if file exists
    filename = 'data/'+filename
    try:
        with open(filename) as f:
            db = pickle.load(f)
    except IOError:
        with open(filename, 'w') as f:
            print 'ioerrer'
            db = {}
            pickle.dump(db, f)
    yield db

    with open(filename, 'w') as f:
        pickle.dump(db, f)
<commit_msg>fixed file location again<commit_after>from datetime import datetime
from contextlib import contextmanager
import pickle


@contextmanager
def lazydb(filename):
    # check if file exists
    filename = filename
    try:
        with open(filename) as f:
            db = pickle.load(f)
    except IOError:
        with open(filename, 'w') as f:
            print 'ioerrer'
            db = {}
            pickle.dump(db, f)
    yield db

    with open(filename, 'w') as f:
        pickle.dump(db, f)

{'fraction_non_alphanumeric': 0.09018036072144289, 'fraction_numerical': 0.0, 'mean_word_length': 2.191693290734824, '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': '2025734', 'n_tokens_mistral': 300, 'n_tokens_neox': 295, 'n_words': 97}