code: def goals_by_version(self):
      
      v1, ambiguous, v2 = [], [], []
      for goal in self._goals:
        goal_dot = '{}.'.format(goal)
        scope_categories = {s.category
                            for s in self.known_scope_to_info.values()
                            if s.scope == goal or s.scope.startswith(goal_dot)}
        is_v1 = ScopeInfo.TASK in scope_categories
        is_v2 = ScopeInfo.GOAL in scope_categories
        if is_v1 and is_v2:
          ambiguous.append(goal)
        elif is_v1:
          v1.append(goal)
        else:
          v2.append(goal)
      return tuple(v1), tuple(ambiguous), tuple(v2)
docs: Goals organized into three tuples by whether they are v1, ambiguous, or v2 goals (respectively).
  
      It's possible for a goal to be implemented with both v1 and v2, in which case a consumer
      should use the `--v1` and `--v2` global flags to disambiguate.