<commit_before>#!/usr/bin/python3

import sys, os

# now that we're in directory 'tools/' we have to update sys.path
sys.path.append(os.path.dirname(sys.path[0]))

from rom.ips import IPS_Patch
from rom.rom import pc_to_snes

vanilla=sys.argv[1]
ips_ranges = []

def addRanges(name, patch):
    for r in patch.getRanges():
        ips_ranges.append({'name':name, 'range':r})

def loadPatchPy():
    from rando.patches import patches as patches_py
    for name,patch in patches_py.items():
        addRanges(name, IPS_Patch(patch))

for patch in sys.argv[2:]:
    baseName = os.path.basename(patch)
    if baseName == "patches.py":
        loadPatchPy()
    else:
        addRanges(baseName, IPS_Patch.load(patch))

overlaps = {}
last, lstop = None, -1
for rg in sorted(ips_ranges, key=lambda r:r['range'].start):
    thisStart = rg['range'].start
    if last and lstop > thisStart and lstop != 0x7fe0: # overlap, skip checksum<commit_msg>tools: fixed ips check for new folder structure<commit_after>#!/usr/bin/python3

import sys, os

# now that we're in directory 'tools/' we have to update sys.path
sys.path.append(os.path.dirname(sys.path[0]))

from rom.ips import IPS_Patch
from rom.rom import pc_to_snes

vanilla=sys.argv[1]
ips_ranges = []

def addRanges(name, patch):
    for r in patch.getRanges():
        ips_ranges.append({'name':name, 'range':r})

def loadPatchPy():
    from patches.common.patches import patches as patches_py
    for name,patch in patches_py.items():
        addRanges(name, IPS_Patch(patch))

for patch in sys.argv[2:]:
    baseName = os.path.basename(patch)
    if baseName == "patches.py":
        loadPatchPy()
    else:
        addRanges(baseName, IPS_Patch.load(patch))

overlaps = {}
last, lstop = None, -1
for rg in sorted(ips_ranges, key=lambda r:r['range'].start):
    thisStart = rg['range'].start
    if last and lstop > thisStart and lstop != 0x7fe0: # overlap, skip checksum
{'fraction_non_alphanumeric': 0.13027618551328818, 'fraction_numerical': 0.008337675872850442, 'mean_word_length': 3.836272040302267, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '4075721', 'n_tokens_mistral': 685, 'n_tokens_neox': 673, 'n_words': 178}