code: def filter(self, nodes):
          
  
          filtered_dag = DAG()
  
          # Add only the nodes we need.
          for node in nodes:
              filtered_dag.add_node_if_not_exists(node)
              for edge in self.all_downstreams(node):
                  filtered_dag.add_node_if_not_exists(edge)
  
          # Now, rebuild the graph for each node that's present.
          for node, edges in self.graph.items():
              if node in filtered_dag.graph:
                  filtered_dag.graph[node] = edges
  
          return filtered_dag
docs: Returns a new DAG with only the given nodes and their
          dependencies.
  
          Args:
              nodes (list): The nodes you are interested in.
  
          Returns:
              :class:`stacker.dag.DAG`: The filtered graph.