def METHOD_NAME(self, stages, path, scenario):
    """Validate the all of the stages."""
    matches = []
    categories = set()
    if len(stages) < 1:  # pylint: disable=C1801
        self.logger.debug(
            "Stages was empty. Should have been caught by generic linting."
        )
        return matches
    for sidx, stage in enumerate(stages):
        for aidx, action in enumerate(stage.get("Actions", [])):
            action_type_id = action.get("ActionTypeId")
            categories.add(action_type_id.get("Category"))
            if sidx > 0 and action_type_id.get("Category") == "Source":
                message = (
                    "Only the first stage of a pipeline may contain source actions."
                )
                matches.append(
                    RuleMatch(
                        path + [sidx, "Actions", aidx],
                        self._format_error_message(message, scenario),
                    )
                )
    if not categories - set(["Source"]):
        message = "At least one stage in pipeline must contain an action that is not a source action."
        matches.append(
            RuleMatch(path, self._format_error_message(message, scenario))
        )
    return matches