code: def sorted_source_files(self):
          assert self.final, 'Call build() before using the graph.'
          out = []
          for node in nx.topological_sort(self.graph):
              if isinstance(node, NodeSet):
                  out.append(node.nodes)
              else:
                  out.append([node])
          return list(reversed(out))