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

import re

def count_rounds():
    global current_round
    current_round = 1
    with open('result.txt', 'r') as input:
        input_str = input.readline().strip()
        while input_str:
            while not(input_str.startswith('end')):
                input_str = input.readline().strip()
            input_str = input.readline().strip()
            input_str = input.readline().strip()
            current_round += 1

def initialize():
    global bidders_num
    global has_random_bidder
    global rounds
    global all_bids_are_announced
    global are_discrete_bids
    global bids
    with open('setup.txt', 'r') as input:
        bidders_num = input.readline().strip()
        has_random_bidder = (input.readline().strip() == '1')
        rounds = input.readline().strip()
        all_bids_are_announced = (input.readline().strip() == '1')
        bids_string = input.readline().strip()
        are_discrete_bids = bool(re.compile('^\{.+\}$').match(bids_string))
    bids = bids_string[1:len(bids_string)-1].split(',')
    for i in range(len(bids)):
        if re.compile('^\d+\/\d+$').match(bids[i]):
            bids[i] = float(bids[i].split('/')[0]) / float(bids[i].split('/')[1])
        bids[i] = float(bids[i])
    bids.sort()
       
def main():
    initialize()

if __name__ == '__main__':
    main()<commit_msg>Implement previous rounds data reading<commit_after>#!/usr/local/bin/python

import re

def count_rounds():
    global current_round
    current_round = 1
    with open('result.txt', 'r') as input:
        input_str = input.readline().strip()
        while input_str:
            while not(input_str.startswith('end')):
                input_str = input.readline().strip()
            input_str = input.readline().strip()
            input_str = input.readline().strip()
            current_round += 1

def initialize():
    global bidders_num
    global has_random_bidder
    global rounds
    global all_bids_are_announced
    global are_discrete_bids
    global bids
    with open('setup.txt', 'r') as input:
        bidders_num = input.readline().strip()
        has_random_bidder = (input.readline().strip() == '1')
        rounds = input.readline().strip()
        all_bids_are_announced = (input.readline().strip() == '1')
        bids_string = input.readline().strip()
        are_discrete_bids = bool(re.compile('^\{.+\}$').match(bids_string))
    bids = bids_string[1:len(bids_string)-1].split(',')
    for i in range(len(bids)):
        if re.compile('^\d+\/\d+$').match(bids[i]):
            bids[i] = float(bids[i].split('/')[0]) / float(bids[i].split('/')[1])
        bids[i] = float(bids[i])
    bids.sort()

def read_previous_rounds():
    global last_bidders
    global last_last_bidders
    last_bidders = []
    last_last_bidders = []
    with open('result.txt', 'r') as input:
        if current_round == 2:
            input_str = input.readline().strip()
            input_str = input.readline().strip()
            while not(input_str.startswith('end')):
                if not(input_str == '-'):
                    input_list = input_str.split(', ')
                    if input_list[1] == '-':
                        last_bidders.append(Bidder(input_list[0], 0))
                    else:
                        last_bidders.append(Bidder(input_list[0], float(input_list[1])))
                    input_str = input.readline().strip()
        else:
            counter = 1
            input_str = input.readline().strip()
            while input_str and (counter != (current_round - 2)):
                while not(input_str.startswith('end')):
                    input_str = input.readline().strip()
                input_str = input.readline().strip()
                input_str = input.readline().strip()
                counter += 1
            input_str = input.readline().strip()
            while not(input_str.startswith('end')):
                if not(input_str == '-'):
                    input_list = input_str.split(', ')
                    if input_list[1] == '-':
                        last_last_bidders.append(Bidder(input_list[0], 0))
                    else:
                        last_last_bidders.append(Bidder(input_list[0], float(input_list[1])))
                input_str = input.readline().strip()
            input_str = input.readline().strip()
            input_str = input.readline().strip()
            input_str = input.readline().strip()
            while not(input_str.startswith('end')):
                if not(input_str == '-'):
                    input_list = input_str.split(', ')
                    if input_list[1] == '-':
                        last_bidders.append(Bidder(input_list[0], 0))
                    else:
                        last_bidders.append(Bidder(input_list[0], float(input_list[1])))
                input_str = input.readline().strip()

def main():
    initialize()

if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.14877362283876155, 'fraction_numerical': 0.007036590269400885, 'mean_word_length': 2.086228287841191, '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': '855068', 'n_tokens_mistral': 1589, 'n_tokens_neox': 1535, 'n_words': 261}