code: def test_random_maximum_spanning_tree_nx(graph_size):
      rmm.reinitialize(managed_memory=True)
      df = utils.random_edgelist(
          e=graph_size,
          ef=16,
          dtypes={"src": np.int32, "dst": np.int32, "weight": float},
          drop_duplicates=True,
          seed=123456,
      )
      gdf = cudf.from_pandas(df)
      # cugraph
      G = cugraph.Graph()
      G.from_cudf_edgelist(
          gdf, source="src", destination="dst", edge_attr="weight"
      )
      # Just for getting relevant timing
      G.view_adj_list()
      t1 = time.time()
      cugraph.maximum_spanning_tree(G)
      t2 = time.time() - t1
      print("CuGraph time : " + str(t2))
  
      # Nx
      Gnx = nx.from_pandas_edgelist(
          df,
          create_using=nx.Graph(),
          source="src",
          target="dst",
          edge_attr="weight",
      )
      t1 = time.time()
      nx.maximum_spanning_tree(Gnx)
      t3 = time.time() - t1
      print("Nx Time : " + str(t3))
      print("Speedup: " + str(t3 / t2))
  
file_path: cugraph/python/cugraph/cugraph/tests/tree/test_maximum_spanning_tree.py
imports: import time
  import gc
  import rmm
  import pytest
  import numpy
  import networkx
  import cudf
  import cugraph
  from cugraph.testing import utils
  from cugraph.datasets import netscience
label_desc: Use image node_id 5 for calling a global function with example usage: test_random_maximum_spanning_tree_nx(graph_size) without return types