code: def compare_bfs(
      benchmark_callable, G, golden_values, start_vertex, depth_limit
  ):
      """
      Generate both cugraph and reference bfs traversal.
      """
  
      if isinstance(start_vertex, int):
          result = benchmark_callable(
              cugraph.bfs_edges, G, start_vertex
          )
          cugraph_df = convert_output_to_cudf(G, result)
          compare_func = _compare_bfs
  
          # NOTE: We need to take 2 different path for verification as the nx
          #       functions used as reference return dictionaries that might
          #       not contain all the vertices while the cugraph version return
          #       a cudf.DataFrame with all the vertices, also some verification
          #       become slow with the data transfer
          compare_func(cugraph_df, golden_values, start_vertex)
  
      elif isinstance(start_vertex, list):  # For other Verifications
          all_golden_values = golden_values
          all_cugraph_distances = []
  
          def func_to_benchmark():
              for sv in start_vertex:
                  cugraph_df = cugraph.bfs_edges(
                      G, sv, depth_limit=depth_limit
                  )
                  all_cugraph_distances.append(cugraph_df)
  
          benchmark_callable(func_to_benchmark)
  
          compare_func = _compare_bfs
          for i, sv in enumerate(start_vertex):
              cugraph_df = convert_output_to_cudf(
                  G, all_cugraph_distances[i]
              )
  
              compare_func(cugraph_df, all_golden_values[i], sv)
  
      else:  # Unknown type given to seed
          raise NotImplementedError("Invalid type for start_vertex")
  
imports: import gc
  import pytest
  import cupy
  import numpy
  from scipy.sparse import coo_matrix
  from scipy.sparse import csr_matrix
  from scipy.sparse import csc_matrix
  import cudf
  import cugraph
  from cupyx.scipy.sparse import coo_matrix
  from cupyx.scipy.sparse import csr_matrix
  from cupyx.scipy.sparse import csc_matrix
  from pylibcugraph.testing.utils import gen_fixture_params_product
  from cugraph.testing import utils, get_resultset, load_resultset, DEFAULT_DATASETS, SMALL_DATASETS
label_desc: Use image node_id 4 for calling a global function with example usage: compare_bfs(benchmark_callable, G, golden_values, start_vertex, depth_limit) without return types