<commit_before>#!/usr/bin/env python

import os

THIS_SCRIPT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
THIS_REPO_PATH = os.path.abspath(os.path.join(THIS_SCRIPT_DIRECTORY, os.pardir))
REPO_PARENT_PATH = os.path.abspath(os.path.join(THIS_SCRIPT_DIRECTORY, os.pardir, os.pardir))

# Lets us combine ignore lists:
#   from private&public fuzzing repos
#   for project branches and for their base branches (e.g. mozilla-central)
#
# Given a targetRepo "mozilla-central/ionmonkey" and a name "crashes.txt", returns a list of 2N absolute paths like:
#   ???/funfuzz*/known/mozilla-central/ionmonkey/crashes.txt
#   ???/funfuzz*/known/mozilla-central/crashes.txt


def findIgnoreLists(targetRepo, needle):
    r = []
    assert not targetRepo.startswith("/")
    for name in sorted(os.listdir(REPO_PARENT_PATH)):
        if name.startswith("fuzzing") or name.startswith("funfuzz"):
            knownPath = os.path.join(REPO_PARENT_PATH, name, "known", targetRepo)
            if os.path.isdir(knownPath):
                while os.path.basename(knownPath) != "known":
                    filename = os.path.join(knownPath, needle)
                    if os.path.exists(filename):
                        r.append(filename)
                    knownPath = os.path.dirname(knownPath)
    assert len(r) > 0
    return r<commit_msg>Stop looking in the old fuzzing/ directory<commit_after>#!/usr/bin/env python

import os

THIS_SCRIPT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
THIS_REPO_PATH = os.path.abspath(os.path.join(THIS_SCRIPT_DIRECTORY, os.pardir))
REPO_PARENT_PATH = os.path.abspath(os.path.join(THIS_SCRIPT_DIRECTORY, os.pardir, os.pardir))

# Lets us combine ignore lists:
#   from private&public fuzzing repos
#   for project branches and for their base branches (e.g. mozilla-central)
#
# Given a targetRepo "mozilla-central/ionmonkey" and a name "crashes.txt", returns a list of 2N absolute paths like:
#   ???/funfuzz*/known/mozilla-central/ionmonkey/crashes.txt
#   ???/funfuzz*/known/mozilla-central/crashes.txt


def findIgnoreLists(targetRepo, needle):
    r = []
    assert not targetRepo.startswith("/")
    for name in sorted(os.listdir(REPO_PARENT_PATH)):
        if name.startswith("funfuzz"):
            knownPath = os.path.join(REPO_PARENT_PATH, name, "known", targetRepo)
            if os.path.isdir(knownPath):
                while os.path.basename(knownPath) != "known":
                    filename = os.path.join(knownPath, needle)
                    if os.path.exists(filename):
                        r.append(filename)
                    knownPath = os.path.dirname(knownPath)
    assert len(r) > 0
    return r
{'fraction_non_alphanumeric': 0.11932457786116323, 'fraction_numerical': 0.00150093808630394, 'mean_word_length': 3.082695252679939, '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': '5292273', 'n_tokens_mistral': 935, 'n_tokens_neox': 882, 'n_words': 179}