code: def test_boost_example(self):
      # Graph taken from Figure 1 of
      # http://www.boost.org/doc/libs/1_56_0/libs/graph/doc/lengauer_tarjan_dominator.htm
      edges = [
          (0, 1),
          (1, 2),
          (1, 3),
          (2, 7),
          (3, 4),
          (4, 5),
          (4, 6),
          (5, 7),
          (6, 4),
      ]
      G = nx.DiGraph(edges)
      result = nx.immediate_dominators(G, 0)
      assert result == {0: 0, 1: 0, 2: 1, 3: 1, 4: 3, 5: 4, 6: 4, 7: 1}
      # Test postdominance.
      result = nx.immediate_dominators(G.reverse(copy=False), 7)
      assert result == {0: 1, 1: 7, 2: 7, 3: 4, 4: 5, 5: 7, 6: 4, 7: 7}
  
imports: import pytest
  import networkx
label_desc: Use image node_id 9 for calling the TestImmediateDominators obj's underlying member method code with example usage: obj.test_boost_example() without return types