<commit_before>__author__ = 'sachinpatney'

import fcntl, time, csv, os
from common import STATUS_FILE_LOCK
from thread import start_new_thread

def sync_write_to_file(name, operation, message):
    with open(name, operation) as f:
        fcntl.flock(f.fileno(), fcntl.LOCK_EX)
        f.write(message)

def read_csv(path):
    reader = csv.reader(open(path, 'rb'))
    return dict(x for x in reader)


def write_to_csv(dict, path):
    writer = csv.writer(open(path, 'wb'))
    for key, value in dict.items():
        writer.writerow([key, value])




start_new_thread(sync_write_to_status_file, ('broken', True,))
start_new_thread(sync_write_to_status_file, ('key', 'somevalue',))

time.sleep(3)<commit_msg>updating tasks<commit_after>__author__ = 'sachinpatney'

# Just a test area for scripts
{'fraction_non_alphanumeric': 0.12170639899623588, 'fraction_numerical': 0.0012547051442910915, 'mean_word_length': 4.911111111111111, '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': '7612588', 'n_tokens_mistral': 290, 'n_tokens_neox': 280, 'n_words': 66}