code: def test_no_perfect_matching_raises():
      G = nx.Graph([(0, 1), (0, 2)])
      with pytest.raises(
          nx.NetworkXError, match=".*not contain a perfect matching"
      ):
          nx.bipartite.maximal_extendability(G)
  
file_path: networkx/networkx/algorithms/bipartite/tests/test_extendability.py
imports: import pytest
  import networkx
label_desc: Use image node_id 4 for calling a global function with example usage: test_no_perfect_matching_raises() without return types