code: def execution_order(self, refcounts):
          return iter(nx.topological_sort(
              self.graph.subgraph(
                  {term for term, refcount in refcounts.items() if refcount > 0},
              ),
          ))