code: def test_to_edgelist_custom_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_col_name")
      pytest.raises(
          nx.NetworkXError,
          nx.to_pandas_edgelist,
          G,
          source="source_col_name",
      )
  
      # drop source column to test an exception raised for the target column
      for u, v, d in G.edges(data=True):
          d.pop("source_col_name", None)
  
      nx.set_edge_attributes(G, 0, name="target_col_name")
      pytest.raises(
          nx.NetworkXError,
          nx.to_pandas_edgelist,
          G,
          target="target_col_name",
      )
  
imports: import pytest
  import networkx
  from networkx.utils import edges_equal, graphs_equal, nodes_equal
label_desc: Use image node_id 13 for calling the TestConvertPandas obj's underlying member method code with example usage: obj.test_to_edgelist_custom_source_or_target_col_exists() without return types