code: def create_mg_graph(graph_data):
      """
      Create a graph instance based on the data to be loaded/generated, return a
      tuple containing (graph_obj, num_verts, client, cluster)
      """
      # range starts at 1 to let let 0 be used by benchmark/client process
      visible_devices = os.getenv("DASK_WORKER_DEVICES", "1,2,3,4")
  
      (client, cluster) = start_dask_client(
          # enable_tcp_over_ucx=True,
          # enable_infiniband=False,
          # enable_nvlink=True,
          # enable_rdmacm=False,
          protocol="ucx",
          rmm_pool_size="28GB",
          dask_worker_devices=visible_devices,
      )
      rmm.reinitialize(pool_allocator=True)
  
      # FIXME: need to consider directed/undirected?
      G = MultiGraph(directed=True)
  
      # Assume strings are names of datasets in the datasets package
      if isinstance(graph_data, str):
          ds = getattr(datasets, graph_data)
          edgelist_df = ds.get_edgelist()
          # FIXME: edgelist_df should have column names that match the defaults
          # for G.from_cudf_edgelist()
          edgelist_df = dask_cudf.from_cudf(edgelist_df)
          G.from_dask_cudf_edgelist(
              edgelist_df,
              source="src",
              destination="dst",
              edge_attr="wgt",
          )
          num_verts = G.number_of_vertices()
  
      # Assume dictionary contains RMAT params
      elif isinstance(graph_data, dict):
          scale = graph_data["scale"]
          num_verts = 2**scale
          num_edges = num_verts * graph_data["edgefactor"]
          seed = _seed
          edgelist_df = rmat(
              scale,
              num_edges,
              0.57,  # from Graph500
              0.19,  # from Graph500
              0.19,  # from Graph500
              seed,
              clip_and_flip=False,
              scramble_vertex_ids=False,  # FIXME: need to understand relevance of this
              create_using=None,  # None == return edgelist
              mg=True,
          )
          edgelist_df["weight"] = np.float32(1)
  
          G.from_dask_cudf_edgelist(
              edgelist_df,
              source="src",
              destination="dst",
              edge_attr="weight",
          )
  
      else:
          raise TypeError(
              f"graph_data can only be str or dict, got {type(graph_data)}"
          )
  
      return (G, num_verts, client, cluster)
  
file_path: cugraph/benchmarks/cugraph/pytest-based/bench_cugraph_uniform_neighbor_sample.py
imports: import os
  import pytest
  import numpy
  import cupy
  from cugraph.testing.mg_utils import start_dask_client, stop_dask_client
  import cudf
  import dask_cudf
  import rmm
  from cugraph import MultiGraph, uniform_neighbor_sample
  from cugraph.generators import rmat
  from cugraph.experimental import datasets
  from cugraph.dask import uniform_neighbor_sample
  from cugraph_benchmarking import params
  from cugraph_benchmarking.timer import TimerContext
label_desc: Use image node_id 2 for calling a global function with example usage: create_mg_graph(graph_data) and returns: G,  num_verts,  client,  cluster