<commit_before>import gelpia_utils as GU

import queue as Q

def solve(X_0, x_tol, f_tol, func, procs_ignore, profiler):
    local_queue = Q.PriorityQueue()
    local_queue.put((0, 0, X_0))
    priority_fix = 0
    f_best = GU.large_float("-inf");
    
    while not local_queue.empty():
        ignore_0, ignore_1, X = local_queue.get()

        fx = func(X)
        w = X.width()
        fw = fx.width()
        
        if (fx.upper() < f_best or
            w < x_tol or
            fw < f_tol):
            continue
        else:
            box_list = X.split()
            
            for b in box_list:
                e = func(b.midpoint())
                if(e.upper() > f_best):
                    f_best = e.upper()
                priority_fix += 1
                local_queue.put((-e.upper(), priority_fix, b))

    return f_best<commit_msg>priority solver fix<commit_after>import gelpia_utils as GU

import queue as Q

def solve(X_0, x_tol, f_tol, func, procs_ignore, profiler):
    local_queue = Q.PriorityQueue()
    local_queue.put((0, 0, X_0))
    priority_fix = 0
    f_best_low = GU.large_float("-inf")
    f_best_high = GU.large_float("-inf")
    
    while not local_queue.empty():
        ignore_0, ignore_1, X = local_queue.get()
        fx = func(X)
        w = X.width()
        fw = fx.width()
        if (fx.upper() < f_best_low or
            w < x_tol or
            fw < f_tol):
            if f_best_high < fx.upper():
                f_best_high = fx.upper()
        else:
            box_list = X.split()
            
            for b in box_list:
                e = func(b.midpoint())
                if(e.upper() > f_best_low):
                    f_best_low = e.upper()
                priority_fix += 1
                local_queue.put((-e.upper(), priority_fix, b))

    return f_best_high
{'fraction_non_alphanumeric': 0.11408296943231441, 'fraction_numerical': 0.008733624454148471, 'mean_word_length': 1.5672268907563025, 'pattern_counts': {'":': 0, '<': 10, '<?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': '4014260', 'n_tokens_mistral': 637, 'n_tokens_neox': 607, 'n_words': 141}