import random


def get_best_move(board, scores):
    """
    Function that finds the best move(s) for the computer
    given the sum scores for many MC trials of each cell
    on the current, active board
    
    Returns the cell to play (randomly chosen if multiple high score)
    """
      
    max_score = float("-inf")
    
    # potential candidate choices, initially empty
    top_score_cells = []
    
    for (row, col) in board.get_empty_squares():
        cell_score = scores[row][col]
        # if new max score, dump out potential choices and put it this one
        if cell_score > max_score:
            top_score_cells = [(row, col)]
            max_score = cell_score
        # if matches max score, add it to potential choices
        elif cell_score is max_score:
            top_score_cells.append((row, col))
    
    # return a random choice amongst the potential candidates
    return random.choice(top_score_cells)