def select_nodes(batch_data, roots):
    """
    Run 'select' in MCTS on a batch of root nodes.
    """
    nodes = []
    for i, root in enumerate(roots):
        data = batch_data[i]
        game = data[0]
        state = data[1]
        player_1 = data[2]
        player_2 = data[3]
        root = roots[i]

        player = player_1 if game.player(state) else player_2

        nodes.append(player.select(root))
    return nodes