<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clone(self, ignore=()):
 """ Clone this dag using a set of substitutions. Traverse the dag in topological order. """

        nodes = [
            clone(node, self.substitutions, ignore)
            for node in toposorted(self.nodes, self.edges)
        ]
        return DAG(nodes=nodes, substitutions=self.substitutions).build_edges()