nodes: 0, module; 1, function_definition; 2, function_name:iterate; 3, parameters; 4, block; 5, identifier:self; 6, identifier:scopes; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, comment:"""Yields ScopeInfo instances for the specified scopes, plus relevant related scopes.
  
      Relevant scopes are:
        - All tasks in a requested goal.
        - All subsystems tied to a request scope.
  
      Yields in a sensible order: Sorted by scope, but with subsystems tied to a request scope
      following that scope, e.g.,
  
      goal1
      goal1.task11
      subsys.goal1.task11
      goal1.task12
      goal2.task21
      ...
      """; 11, assignment; 12, identifier:scope_infos; 13, block; 14, identifier:scope_infos; 15, list_comprehension; 16, for_statement; 17, subscript; 18, for_in_clause; 19, identifier:scope_info; 20, call; 21, block; 22, attribute; 23, identifier:s; 24, identifier:s; 25, call; 26, attribute; 27, argument_list; 28, expression_statement; 29, identifier:self; 30, identifier:_scope_to_info; 31, attribute; 32, argument_list; 33, identifier:self; 34, identifier:_expand_subsystems; 35, identifier:scope_infos; 36, yield; 37, identifier:self; 38, identifier:_expand_tasks; 39, identifier:scopes; 40, identifier:scope_info
code: def iterate(self, scopes):
      """Yields ScopeInfo instances for the specified scopes, plus relevant related scopes.
  
      Relevant scopes are:
        - All tasks in a requested goal.
        - All subsystems tied to a request scope.
  
      Yields in a sensible order: Sorted by scope, but with subsystems tied to a request scope
      following that scope, e.g.,
  
      goal1
      goal1.task11
      subsys.goal1.task11
      goal1.task12
      goal2.task21
      ...
      """
      scope_infos = [self._scope_to_info[s] for s in self._expand_tasks(scopes)]
      if scope_infos:
        for scope_info in self._expand_subsystems(scope_infos):
          yield scope_info