code: def test_to_undirected(graph_file):
      # Read data and then convert to directed by dropped some edges
      cu_M = utils.read_csv_file(graph_file)
      cu_M = cu_M[cu_M["0"] <= cu_M["1"]].reset_index(drop=True)
  
      M = utils.read_csv_for_nx(graph_file)
      M = M[M["0"] <= M["1"]]
      assert len(cu_M) == len(M)
  
      # cugraph add_edge_list
      DiG = cugraph.Graph(directed=True)
      DiG.from_cudf_edgelist(cu_M, source="0", destination="1")
  
      DiGnx = nx.from_pandas_edgelist(
          M, source="0", target="1", create_using=nx.DiGraph()
      )
  
      for index, row in cu_M.to_pandas().iterrows():
          assert DiG.has_edge(row["0"], row["1"])
          assert not DiG.has_edge(row["1"], row["0"])
  
      G = DiG.to_undirected()
      Gnx = DiGnx.to_undirected()
  
      assert not G.is_directed()
      assert G.number_of_nodes() == Gnx.number_of_nodes()
      assert G.number_of_edges() == Gnx.number_of_edges()
      assert G._plc_graph is not None
  
      for index, row in cu_M.to_pandas().iterrows():
          assert G.has_edge(row["0"], row["1"])
          assert G.has_edge(row["1"], row["0"])
  
imports: import gc
  import time
  import pytest
  import pandas
  import scipy
  import networkx
  import cupy
  import cudf
  import cugraph
  from cugraph.testing import utils
  from cudf.testing import assert_series_equal
  from cudf.testing.testing import assert_frame_equal
  import dask_cudf
  import cugraph.dask
  from dask.distributed import Client
  from dask_cuda import LocalCUDACluster
  from pylibcugraph import ResourceHandle
  from pylibcugraph import bfs
  from cugraph.dask.traversal.bfs import convert_to_cudf
  from cugraph.dask.common.mg_utils import is_single_gpu
label_desc: Use image node_id 20 for calling a global function with example usage: test_to_undirected(graph_file) without return types