def split_config(raw):
    """Split configuration into overall and per-stage."""
    for (i, entry) in enumerate(raw):
        if "overall" in entry:
            del raw[i]
            return entry["overall"], raw
    return {}, raw