code: def test_from_adjlist(graph_file):
      """
      Compare the resulting Graph objs from cugraph.from_adjlist() calls of both
      a cudf and pandas DataFrame and ensure the results are equal.
      """
      G = utils.generate_cugraph_graph_from_file(
          graph_file, directed=True
      )
      (cu_offsets, cu_indices, cu_vals) = G.view_adj_list()
  
      pd_offsets = cu_offsets.to_pandas()
      pd_indices = cu_indices.to_pandas()
      if cu_vals is not None:
          pd_vals = cu_vals.to_pandas()
      else:
          pd_vals = None
  
      # FIXME: should mixing types be allowed?
      with pytest.raises(TypeError):
          G1 = cugraph.from_adjlist(cu_offsets, pd_indices)
      with pytest.raises(TypeError):
          G1 = cugraph.from_adjlist(
              cu_offsets, cu_indices, cu_vals, create_using=33
          )
  
      G1 = cugraph.from_adjlist(
          cu_offsets,
          cu_indices,
          cu_vals,
          create_using=cugraph.Graph(directed=True),
      )
      G2 = cugraph.from_adjlist(
          pd_offsets,
          pd_indices,
          pd_vals,
          create_using=cugraph.Graph(directed=True),
      )
  
      assert G1.AdjList == G2.AdjList
  
file_path: cugraph/python/cugraph/cugraph/tests/structure/test_convert_matrix.py
imports: import gc
  import pytest
  import numpy
  import networkx
  import cugraph
  from cugraph.testing import utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_from_adjlist(graph_file) without return types