code: def test_leiden_nx(graph_file):
      dataset_path = graph_file.get_path()
      NM = utils.read_csv_for_nx(dataset_path)
  
      G = nx.from_pandas_edgelist(
          NM,
          create_using=nx.Graph(),
          source="0",
          target="1",
          edge_attr="weight",
      )
  
      leiden_parts, leiden_mod = cugraph_leiden(G)
      louvain_parts, louvain_mod = cugraph_louvain(G)
  
      # Calculating modularity scores for comparison
      # Leiden modularity score is smaller than Louvain's
      assert leiden_mod >= (0.75 * louvain_mod)
  
file_path: cugraph/python/cugraph/cugraph/tests/community/test_leiden.py
imports: import gc
  import time
  import pytest
  import networkx
  import cugraph
  import cudf
  from cugraph.testing import utils, UNDIRECTED_DATASETS
  from cugraph.datasets import karate_asymmetric
label_desc: Use image node_id 6 for calling a global function with example usage: test_leiden_nx(graph_file) without return types