<commit_before>import pickle
import re
import sys

def main(argv):
    source = argv[1]
    dest = argv[2]
    with open('.coverage', 'rb') as f:
        coverage_data = pickle.load(f)

    # Prefilter to filenames in NetworkX
    filenames = [filename for filename in coverage_data['lines'].keys()
                 if 'networkx' in filename]

    for filename in filenames:
        new_filename = re.sub(source, dest, filename)
        if new_filename != filename:
            coverage_data['lines'][new_filename] = coverage_data['lines'].pop(filename)

    with open('.coverage', 'wb') as f:
        pickle.dump(coverage_data, f)

if __name__ == '__main__':
    sys.exit(main(sys.argv))<commit_msg>Update fixcoverage.py<commit_after>import coverage
import re
import sys

def main(argv):
    source = argv[1]
    dest = argv[2]
    coverage_data = coverage.CoverageData()
    coverage_data.read_file('.coverage')

    # Prefilter to filenames in NetworkX
    filenames = [filename for filename in coverage_data._lines.keys()
                 if 'networkx' in filename]

    for filename in filenames:
        new_filename = re.sub(source, dest, filename)
        if new_filename != filename:
            coverage_data._lines[new_filename] = coverage_data._lines.pop(filename)
        
    coverage_data.write_file('.coverage')

if __name__ == '__main__':
    sys.exit(main(sys.argv))
{'fraction_non_alphanumeric': 0.11127167630057803, 'fraction_numerical': 0.002890173410404624, 'mean_word_length': 3.0855457227138645, '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': '7608858', 'n_tokens_mistral': 434, 'n_tokens_neox': 432, 'n_words': 106}