code: def create_remote_graph(graph_data, is_mg, client):
      """
      Create a remote graph instance based on the data to be loaded/generated,
      relying on server-side graph creation extensions, return a tuple containing
      the remote graph instance and the number of vertices it contains.
  
      The server extension is part of the
      "cugraph_service_server.testing.benchmark_server_extension" and is loaded
      in the ensure_running_server_for_sampling() utility.
      """
      # Assume strings are names of datasets in the datasets package
      if isinstance(graph_data, str):
          gid = client.call_graph_creation_extension(
              "create_graph_from_builtin_dataset", graph_data
          )
          num_verts = client.get_num_vertices(graph_id=gid)
  
      # 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
          gid = client.call_graph_creation_extension(
              "create_graph_from_rmat_generator",
              scale=scale,
              num_edges=num_edges,
              seed=seed,
              mg=is_mg,
          )
      else:
          raise TypeError(
              f"graph_data can only be str or dict, got {type(graph_data)}"
          )
  
      G = RemoteGraph(client, gid)
      return (G, num_verts)
  
file_path: cugraph/benchmarks/cugraph-service/pytest-based/bench_cgs_uniform_neighbor_sample.py
imports: import os
  from pathlib import Path
  import pytest
  import numpy
  from cugraph_service_client import CugraphServiceClient
  from cugraph_service_client.exceptions import CugraphServiceError
  from cugraph_service_client import RemoteGraph
  from cugraph_service_server.testing import utils
  from cugraph_benchmarking import params
  from cugraph_benchmarking.timer import TimerContext
label_desc: Use image node_id 1 for calling a global function with example usage: create_remote_graph(graph_data, is_mg, client) and returns: G,  num_verts