def METHOD_NAME(stages: List[WarmupStage]) -> List[WarmupStage]:
    last_stage = WarmupStage(policy=WarmupPolicy.NONE, max_iters=1 << 63, value=1.0)
    if len(stages) == 0:
        return [last_stage]
    start_iter = 0
    for stage in stages:
        assert stage.max_iters > start_iter, (
            f"Max iter of the stage {stage} must be greater than the previous "
            f"max iter {start_iter}"
        )
        start_iter = stage.max_iters
        if stage.decay_iters <= 0:
            if stage.policy == WarmupPolicy.STEP:
                stage.decay_iters = 1
            else:
                stage.decay_iters = stage.max_iters
    return stages + [last_stage]