class_docstr: Dealing with Repeat.
  
  The depth choice should already have been handled in :class:`ParameterChoiceLeafMutator` and :class:`ParameterChoiceMutator`.
code: def _retrieve_chain_from_graph(self, graph: Graph) -> List[Node]:
      u = graph.input_node
      chain = []
      while u != graph.output_node:
          if u != graph.input_node:
              chain.append(u)
          assert (
              len(u.successors) == 1
          ), f"This graph is an illegal chain. {u} has output {u.successors}."
          u = u.successors[0]
      return chain
  
imports: from __future__ import annotations
  from typing import Any, List, Tuple, Dict, Iterable, cast
  from nni.mutable import MutableExpression, Categorical, frozen_context, label_scope
  from nni.nas.space import Graph, GraphModelSpace, Node, StationaryMutator, Mutator
  from nni.nas.space.graph_op import Cell
label_desc: Use image node_id 2 for calling the RepeatMutator obj's underlying member method code with example usage: obj._retrieve_chain_from_graph(graph) and returns: chain