code: def test_louvain_csr_graph(is_weighted):
      karate = UNDIRECTED_DATASETS[0]
      df = karate.get_edgelist()
  
      M = cupyx.scipy.sparse.coo_matrix(
          (
              df["wgt"].to_cupy(),
              (df["src"].to_cupy(), df["dst"].to_cupy()),
          )
      )
      M = M.tocsr()
  
      offsets = cudf.Series(M.indptr)
      indices = cudf.Series(M.indices)
      weights = cudf.Series(M.data)
      G_csr = cugraph.Graph()
      G_coo = karate.get_graph()
  
      if not is_weighted:
          weights = None
  
      G_csr.from_cudf_adjlist(offsets, indices, weights)
  
      assert G_csr.is_weighted() is is_weighted
  
      louvain_csr, mod_csr = cugraph.louvain(G_csr)
      louvain_coo, mod_coo = cugraph.louvain(G_coo)
      louvain_csr = louvain_csr.sort_values("vertex").reset_index(
          drop=True
      )
      result_louvain = (
          louvain_coo.sort_values("vertex")
          .reset_index(drop=True)
          .rename(columns={"partition": "partition_coo"})
      )
      result_louvain["partition_csr"] = louvain_csr["partition"]
  
      parition_diffs = result_louvain.query(
          "partition_csr != partition_coo"
      )
  
      assert len(parition_diffs) == 0
      assert mod_csr == mod_coo
  
file_path: cugraph/python/cugraph/cugraph/tests/community/test_louvain.py
imports: import gc
  import time
  import pytest
  import networkx
  import cugraph
  import cupyx
  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_louvain_csr_graph(is_weighted) without return types