code: def test_rich_club_selfloop():
      G = nx.Graph()  # or DiGraph, MultiGraph, MultiDiGraph, etc
      G.add_edge(1, 1)  # self loop
      G.add_edge(1, 2)
      with pytest.raises(
          Exception,
          match="rich_club_coefficient is not implemented for "
          "graphs with self loops.",
      ):
          nx.rich_club_coefficient(G)
  
file_path: networkx/networkx/algorithms/tests/test_richclub.py
imports: import pytest
  import networkx
label_desc: Use image node_id 9 for calling a global function with example usage: test_rich_club_selfloop() without return types