code: def running_server_for_sampling_with_graph(request):
      """
      This fixture will yield a graph ID that can be used for the server at
      "_host" and "_port" defined in this module, which refers to a RMAT-generated
      graph of "_graph_scale" and "_edge_factor", also defined in this module.  If
      a cugraph-service server is running, it will use that, otherwise it will
      start a new server subprocess.  After the test/benchmark completes and
      control returns to this fixture, the graph is deleted. If the fixture
      started a server subprocess, then it is terminated as well.
      """
      (
          client,
          server_process,
      ) = utils.ensure_running_server_for_sampling(
          host=_host,
          port=_port,
          dask_scheduler_file=None,
          start_local_cuda_cluster=True,
      )
      num_edges = (2**_graph_scale) * _edge_factor
      gid = client.call_graph_creation_extension(
          "create_graph_from_rmat_generator",
          scale=_graph_scale,
          num_edges=num_edges,
          seed=_rng_seed,
          mg=False,
      )
  
      yield gid
  
      client.delete_graph(gid)
  
      if server_process is not None:
          print("\nTerminating server...", end="", flush=True)
          server_process.terminate()
          server_process.wait(timeout=60)
          print("done.", flush=True)
  
file_path: cugraph/benchmarks/cugraph-service/pytest-based/bench_cgs_client_scaling.py
imports: from threading import Thread
  import pytest
  from cugraph_service_client import CugraphServiceClient, defaults
  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: running_server_for_sampling_with_graph(request) without return types