code: def test_modularity_clustering(graph_file, partitions):
      gc.collect()
  
      # Read in the graph and get a cugraph object
      G = graph_file.get_graph()
      # read_weights_in_sp=False => value column dtype is float64
      G.edgelist.edgelist_df["weights"] = G.edgelist.edgelist_df[
          "weights"
      ].astype("float64")
  
      # Get the modularity score for partitioning versus random assignment
      cu_score = cugraph_call(G, partitions)
      rand_score = random_call(G, partitions)
  
      # Assert that the partitioning has better modularity than the random
      # assignment
      assert cu_score > rand_score
  
file_path: cugraph/python/cugraph/cugraph/tests/community/test_modularity.py
imports: import gc
  import random
  import pytest
  import networkx
  import cudf
  import cugraph
  from cugraph.testing import utils, DEFAULT_DATASETS
  from cugraph.utilities import ensure_cugraph_obj_for_nx
label_desc: Use image node_id 3 for calling a global function with example usage: test_modularity_clustering(graph_file, partitions) without return types