def check_successor(self, successor: "Phase") -> None:
    """Raises ValueError if successor is not a valid next phase."""
    if successor not in self.successors:
      raise ValueError(f"The transition from {self} to {successor} is invalid.")
Raises ValueError if successor is not a valid next phase.
concordia/typing/deprecated/entity_component.py