code: def test_tree_all_pairs_lca_disconnected_nodes(self):
      G = nx.DiGraph()
      G.add_node(1)
      assert {(1, 1): 1} == dict(tree_all_pairs_lca(G))
  
      G.add_node(0)
      assert {(1, 1): 1} == dict(tree_all_pairs_lca(G, 1))
      assert {(0, 0): 0} == dict(tree_all_pairs_lca(G, 0))
  
      pytest.raises(nx.NetworkXError, list, tree_all_pairs_lca(G))
  
imports: from itertools import chain, combinations, product
  import pytest
  import networkx
label_desc: Use image node_id 9 for calling the TestTreeLCA obj's underlying member method code with example usage: obj.test_tree_all_pairs_lca_disconnected_nodes() without return types