code: def test_tree_all_pairs_lca_error_if_input_not_tree(self):
      # Cycle
      G = nx.DiGraph([(1, 2), (2, 1)])
      pytest.raises(nx.NetworkXError, list, tree_all_pairs_lca(G))
      # DAG
      G = nx.DiGraph([(0, 2), (1, 2)])
      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 10 for calling the TestTreeLCA obj's underlying member method code with example usage: obj.test_tree_all_pairs_lca_error_if_input_not_tree() without return types