'Helper function to count the number of expansions past the root using the dummy policy'

def _count_expansions(self):

    node = self.mcts._root
    expansions = 0
    for (action, _) in sorted(dummy_policy(self.gs), key=itemgetter(1), reverse=True):
        if (action in node._children):
            expansions += 1
            node = node._children[action]
        else:
            break
    return expansions
