code: def compare_mst(mst_cugraph, mst_nx):
      mst_nx_df = nx.to_pandas_edgelist(mst_nx)
      edgelist_df = mst_cugraph.view_edge_list()
      assert len(mst_nx_df) == len(edgelist_df)
  
      # check cycles
      Gnx = nx.from_pandas_edgelist(
          edgelist_df.to_pandas(),
          create_using=nx.Graph(),
          source="src",
          target="dst",
      )
      try:
          lc = nx.find_cycle(Gnx, source=None, orientation="ignore")
          print(lc)
      except nx.NetworkXNoCycle:
          pass
  
      # check total weight
      cg_sum = edgelist_df[mst_cugraph.weight_column].sum()
      nx_sum = mst_nx_df["weight"].sum()
      print(cg_sum)
      print(nx_sum)
      assert np.isclose(cg_sum, nx_sum)
  
imports: import os
  import pytest
  import pandas
  import networkx
  import numpy
  import cupy
  from cupyx.scipy.sparse import coo_matrix
  from cupyx.scipy.sparse import csr_matrix
  from cupyx.scipy.sparse import csc_matrix
  from scipy.sparse import coo_matrix
  from scipy.sparse import csr_matrix
  from scipy.sparse import csc_matrix
  from pathlib import Path
  import cudf
  import dask_cudf
  import cugraph
  from cugraph.dask.common.mg_utils import get_client
label_desc: Use image node_id 14 for calling a global function with example usage: compare_mst(mst_cugraph, mst_nx) without return types