code: def test_junction_tree_directed_cascade():
      B = nx.DiGraph()
      B.add_edges_from([("A", "B"), ("B", "C"), ("C", "D")])
      G = junction_tree(B)
  
      J = nx.Graph()
      J.add_edges_from(
          [
              (("A", "B"), ("B",)),
              (("B",), ("B", "C")),
              (("B", "C"), ("C",)),
              (("C",), ("C", "D")),
          ]
      )
      assert nx.is_isomorphic(G, J)
  
imports: import networkx
  from networkx.algorithms.tree.decomposition import junction_tree
label_desc: Use image node_id 3 for calling a global function with example usage: test_junction_tree_directed_cascade() without return types