code: def test_exceptions(self):
      G = nx.Graph()
      G.add_node(0)
      pytest.raises(
          nx.NetworkXNotImplemented, nx.immediate_dominators, G, 0
      )
      G = nx.MultiGraph(G)
      pytest.raises(
          nx.NetworkXNotImplemented, nx.immediate_dominators, G, 0
      )
      G = nx.DiGraph([[0, 0]])
      pytest.raises(nx.NetworkXError, nx.immediate_dominators, G, 1)
  
imports: import pytest
  import networkx
label_desc: Use image node_id 1 for calling the TestImmediateDominators obj's underlying member method code with example usage: obj.test_exceptions() without return types