code: def test_preorder_nodes(self):
      assert list(nx.dfs_preorder_nodes(self.G, source=0)) == [
          0,
          1,
          2,
          4,
          3,
      ]
      assert list(nx.dfs_preorder_nodes(self.D)) == [0, 1, 2, 3]
      assert list(nx.dfs_preorder_nodes(self.D, source=2)) == [2, 3]
  
imports: import networkx
label_desc: Use image node_id 2 for calling the TestDFS obj's underlying member method code with example usage: obj.test_preorder_nodes() without return types