code: def compare_edges(cg, nxg):
      edgelist_df = cg.view_edge_list()
  
      assert len(edgelist_df) == nxg.size()
      for i in range(len(edgelist_df)):
          assert nxg.has_edge(
              edgelist_df["src"].iloc[i], edgelist_df["dst"].iloc[i]
          )
      return True
  
file_path: cugraph/python/cugraph/cugraph/tests/community/test_subgraph_extraction.py
imports: import gc
  import numpy
  import pytest
  import networkx
  import cudf
  import cugraph
  from cugraph.testing import utils, DEFAULT_DATASETS
  from cugraph.datasets import karate
label_desc: Use image node_id 2 for calling a global function with example usage: compare_edges(cg, nxg) and returns: True