code: def test_self_loops():
      G = nx.Graph()
      G.add_edge(1, 2)
      G.add_edge(1, 1)
      with pytest.raises(nx.NetworkXError):
          nx.non_randomness(G)
  
imports: import pytest
  import networkx
label_desc: Use image node_id 3 for calling a global function with example usage: test_self_loops() without return types