<commit_before>package othello.gui;

import game.api.GameState;
import game.impl.*;
import game.io.InputUnit;

import java.util.List;

public class OthelloGuiInputUnit extends InputUnit {
	private GameState state;
	private OthelloGameFrame gameFrame;
	private String input;
	
	private Move getNextMove(GameState state) {
        if(input.toLowerCase().equals("republish"))
            return null;

		Move result = null;
		try {

			result = new Move(state.getPlayerInTurn(), new GamePiece(
					getGamePieceID(state.getPlayerInTurn(), state)),
					getLocationById(state.getBoard(), input));
		} catch (Exception ex) {
			gameFrame.setStatusLabelText(ex.getMessage());
		}
		return result;
	}

	private String getGamePieceID(Player player, GameState gameState) {
		if (player == gameState.getPlayers().get(0))
			return "O";
		else
			return "X";
	}

    private BoardLocation getLocationById(Board board, String id){
        List<BoardLocation> locations = board.getLocations();

        for(int i = 0; i < locations.size(); i++)
            if(locations.get(i).getId().equals(id))
                return locations.get(i);

        return null;
    }

	@Override
	public void setup(GameState state) {
		this.state = state;
		this.state.reset();
	}

	public void notifyListeners(String inputTileName) {
		input = inputTileName;
		notifyListenersOfMove(getNextMove(state));
	}
}
<commit_msg>Formatting fix<commit_after>package othello.gui;

import game.api.GameState;
import game.impl.*;
import game.io.InputUnit;

import java.util.List;

public class OthelloGuiInputUnit extends InputUnit {
    private GameState state;
    private OthelloGameFrame gameFrame;
    private String input;

    private Move getNextMove(GameState state) {
	if (input.toLowerCase().equals("republish"))
	    return null;

	Move result = null;
	try {

	    result = new Move(state.getPlayerInTurn(), new GamePiece(
		    getGamePieceID(state.getPlayerInTurn(), state)),
		    getLocationById(state.getBoard(), input));
	} catch (Exception ex) {
	    gameFrame.setStatusLabelText(ex.getMessage());
	}
	return result;
    }

    private String getGamePieceID(Player player, GameState gameState) {
	if (player == gameState.getPlayers().get(0))
	    return "O";
	else
	    return "X";
    }

    private BoardLocation getLocationById(Board board, String id) {
	List<BoardLocation> locations = board.getLocations();

	for (int i = 0; i < locations.size(); i++)
	    if (locations.get(i).getId().equals(id))
		return locations.get(i);

	return null;
    }

    @Override
    public void setup(GameState state) {
	this.state = state;
	this.state.reset();
    }

    public void notifyListeners(String inputTileName) {
	input = inputTileName;
	notifyListenersOfMove(getNextMove(state));
    }
}

{'fraction_non_alphanumeric': 0.11645569620253164, 'fraction_numerical': 0.0014466546112115732, 'mean_word_length': 3.768965517241379, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4139850', 'n_tokens_mistral': 912, 'n_tokens_neox': 855, 'n_words': 202}