code: def test_dfs_tree(self):
      exp_nodes = sorted(self.G.nodes())
      exp_edges = [(0, 1), (1, 2), (1, 3), (2, 4)]
      # Search from first node
      T = nx.dfs_tree(self.G, source=0)
      assert sorted(T.nodes()) == exp_nodes
      assert sorted(T.edges()) == exp_edges
      # Check source=None
      T = nx.dfs_tree(self.G, source=None)
      assert sorted(T.nodes()) == exp_nodes
      assert sorted(T.edges()) == exp_edges
      # Check source=None is the default
      T = nx.dfs_tree(self.G)
      assert sorted(T.nodes()) == exp_nodes
      assert sorted(T.edges()) == exp_edges
  
imports: import networkx
label_desc: Use image node_id 6 for calling the TestDFS obj's underlying member method code with example usage: obj.test_dfs_tree() without return types