code: def test_to_edgelist_default_source_or_target_col_exists(self):
      G = nx.path_graph(10)
      G.add_weighted_edges_from((u, v, u) for u, v in list(G.edges))
      nx.set_edge_attributes(G, 0, name="source")
      pytest.raises(nx.NetworkXError, nx.to_pandas_edgelist, G)
  
      # drop source column to test an exception raised for the target column
      for u, v, d in G.edges(data=True):
          d.pop("source", None)
  
      nx.set_edge_attributes(G, 0, name="target")
      pytest.raises(nx.NetworkXError, nx.to_pandas_edgelist, G)
  
imports: import pytest
  import networkx
  from networkx.utils import edges_equal, graphs_equal, nodes_equal
label_desc: Use image node_id 12 for calling the TestConvertPandas obj's underlying member method code with example usage: obj.test_to_edgelist_default_source_or_target_col_exists() without return types