def METHOD_NAME(status: "DataStatus"):
    """Flatten stage status, and filter empty stage status contents."""
    for stage, stage_status in status.items():
        items = stage_status
        if isinstance(stage_status, dict):
            items = {
                file: state
                for state, files in stage_status.items()
                for file in files
            }
        if not items:
            continue
        yield stage, items