def visualize_mcts(self, root: mzcore.Node,
                     history: Sequence[types.HistoryEntry]) -> str:
    """Visualize the MCTS corresponding to `root` and `history`.

    The returned string can be visualized using the `forest` LaTex package
    (https://ctan.org/pkg/forest?lang=en).

    Args:
      root:  Root node for the Monte-Carlo Tree search.
      history:  History from the Agent's state.

    Returns:
      A `forest`-package compatible string representing the Monte-Carlo Tree
      search tree.
    """

    # Only return a visualization for these history lengths.
    if (common_flags.VISUALIZE_MCTS.value == 0
        or len(history) not in [0, 3, 7, 12, 25]):
      return ''

    return types.visualize_mcts(
        root=root,
        history=history,
        grammar=self.grammar,
        min_visit_count=common_flags.VISUALIZE_MIN_VISIT_COUNT.value)
Visualize the MCTS corresponding to `root` and `history`.

    The returned string can be visualized using the `forest` LaTex package
    (https://ctan.org/pkg/forest?lang=en).

    Args:
      root:  Root node for the Monte-Carlo Tree search.
      history:  History from the Agent's state.

    Returns:
      A `forest`-package compatible string representing the Monte-Carlo Tree
      search tree.
    
language/search_agents/muzero/env.py