code: def bench_weakly_connected_components(gpubenchmark, graph):
      if is_graph_distributed(graph):
          pytest.skip("distributed graphs are not supported")
      if graph.is_directed():
          G = graph.to_undirected()
      else:
          G = graph
      gpubenchmark(cugraph.weakly_connected_components, G)
  
imports: import pytest
  import numpy
  import pytest_benchmark
  import rmm
  import dask_cudf
  from pylibcugraph.testing import gen_fixture_params_product
  import cugraph
  import cugraph.dask
  from cugraph.structure.number_map import NumberMap
  from cugraph.generators import rmat
  from cugraph.testing import utils, mg_utils
  from cugraph.utilities.utils import is_device_version_less_than
  from cugraph_benchmarking.params import directed_datasets, undirected_datasets, managed_memory, pool_allocator
label_desc: Use image node_id 19 for calling a global function with example usage: bench_weakly_connected_components(gpubenchmark, graph) without return types