def METHOD_NAME(stages: list[Stage]):
  """Return a dict with feature IDs as keys and feature's stages as values."""
  stages_by_feature = defaultdict(list)
  for stage in stages:
    stages_by_feature[stage.feature_id].append(stage)
  return stages_by_feature