code: def build_edges(self):
          
          self.edges = [
              edge if isinstance(edge, Edge) else Edge(*edge)
              for node in self.nodes.values()
              for edge in getattr(node, "edges", [])
              if edge[0] in self.nodes and edge[1] in self.nodes
          ]
          return self
docs: Build edges based on node `edges` property.
  
          Filters out any `Edge` not defined in the DAG.