<commit_before>#brutal patch to make use of kernel31 for XP SP3 backward compatibility

import os
import pefile
import sys

for root, dirs, files in os.walk('.'):
    for file in files:
    if file.startswith("kernel31.dll"):
        continue
        fn = root + '\\' + file
        try:
        with open(fn, "rb") as f:
        r = f.read()
            pe = pefile.PE(data=r)
        except pefile.PEFormatError,s:
            continue

    r = r.replace("kernel32", "kernel31").replace("KERNEL32", "KERNEL31")

    os.rename(fn, fn + ".bak32")
    with open(fn, "wb") as f:
        f.write(r)
    continue
    
    # removed: pseudo-smart import patching, not working for on the fly loading.<commit_msg>fixed code<commit_after>#brutal patch to make use of kernel31 for XP SP3 backward compatibility

import os
import pefile
import sys

for root, dirs, files in os.walk('.'):
    for file in files:
        if file.startswith("kernel31.dll"):
            continue
        fn = root + '\\' + file
        try:
            with open(fn, "rb") as f:
                r = f.read()
            pe = pefile.PE(data=r)
        except pefile.PEFormatError,s:
            continue

        r = r.replace("kernel32", "kernel31").replace("KERNEL32", "KERNEL31")
        
        os.rename(fn, fn + ".bak32")
        with open(fn, "wb") as f:
            f.write(r)

    # removed: pseudo-smart import patching, not working for on the fly loading.
{'fraction_non_alphanumeric': 0.11582491582491583, 'fraction_numerical': 0.020202020202020204, 'mean_word_length': 1.90234375, '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': '3210645', 'n_tokens_mistral': 498, 'n_tokens_neox': 455, 'n_words': 143}