<commit_before>package curling;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

public class House {
	private ArrayList<Stone> stones;

	public House() {
		// The house starts with 0 stones, and stones are added as players
		// send them in.
		stones = new ArrayList<Stone>();
	}

	public void addStone(Stone stone) {
		stones.add(stone);
	}

	public HashMap<Team, Integer> calcScore() {
		HashMap<Team, Integer> result = new HashMap<Team, Integer>();
		if (stones.size() == 0) {
			result.put(null, 0);
			return result;
		}
		Team team = stones.get(0).getTeam();
		Integer score = 0;
		for (Stone stone : stones) {
			if (stone.getTeam() != team) {
				break;
			} else {
				++score;
			}
		}
<<<<<<< HEAD
		if(score >= 0){
			result.put(Team.HOME, score);
		} else {
			score = score * -1;
			result.put(Team.AWAY, score);
		}
		result.put(Team.HOME, 0);
		result.put(Team.AWAY, 0);

		if (stones.size() > 0) {
			Collections.sort(stones);
			Stone baseStone = stones.get(0);

			Team currentTeam = null;
			for (Stone stone : stones) {
				currentTeam = stone.getTeam();
				if (baseStone.compareTo(stone) == 0 && baseStone.getTeam() != currentTeam) {
					result.put(baseStone.getTeam(), 0);
					break;
				} else if (currentTeam != baseStone.getTeam()) {
					break;
				} else {
					result.put(currentTeam, result.get(currentTeam) + 1);
				}
			}
		}
=======
		result.put(team, score);
>>>>>>> parent of 2551e6a... Earlier unsynced changes
		return result;
	}

	// These getters/setters are for use by unit tests only.
	public ArrayList<Stone> getStones() {
		return stones;
	}

	public String toString() {
		String output = "";
		for (Stone stone : stones) {
			output += stone + ", ";
		}
		return output;
	}

	public void reset() {
		stones.clear();
	}<commit_msg>Revert 3f5f859..7adf1db<commit_after>package curling;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

public class House {
	private ArrayList<Stone> stones;

	public House() {
		// The house starts with 0 stones, and stones are added as players
		// send them in.
		stones = new ArrayList<Stone>();
	}

	public void addStone(Stone stone) {
		stones.add(stone);
	}

	public HashMap<Team, Integer> calcScore() {
		HashMap<Team, Integer> result = new HashMap<Team, Integer>();
		if (stones.size() == 0) {
			result.put(null, 0);
			return result;
		}
		Team team = Team.HOME;
		Integer score = 0;
		for (Stone stone : stones) {
			if (stone.getTeam() != team) {
				--score;
			} else {
				++score;
			}
		}
		if(score >= 0){
			result.put(Team.HOME, score);
		} else {
			score = score * -1;
			result.put(Team.AWAY, score);
		}
		result.put(Team.HOME, 0);
		result.put(Team.AWAY, 0);

		if (stones.size() > 0) {
			Collections.sort(stones);
			Stone baseStone = stones.get(0);

			Team currentTeam = null;
			for (Stone stone : stones) {
				currentTeam = stone.getTeam();
				if (baseStone.compareTo(stone) == 0 && baseStone.getTeam() != currentTeam) {
					result.put(baseStone.getTeam(), 0);
					break;
				} else if (currentTeam != baseStone.getTeam()) {
					break;
				} else {
					result.put(currentTeam, result.get(currentTeam) + 1);
				}
			}
		}
		return result;
	}

	// These getters/setters are for use by unit tests only.
	public ArrayList<Stone> getStones() {
		return stones;
	}

	public String toString() {
		String output = "";
		for (Stone stone : stones) {
			output += stone + ", ";
		}
		return output;
	}

	public void reset() {
		stones.clear();
	}
{'fraction_non_alphanumeric': 0.15249433106575963, 'fraction_numerical': 0.011054421768707483, 'mean_word_length': 3.0609896432681243, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 26, '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': '477180', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1196, 'n_words': 314}