code: def mg_server():
      """
      Start a cugraph_service server that uses multiple GPUs via a dask
      configuration, then stop it when done with the fixture.
  
      This requires that a dask scheduler be running, and the corresponding
      SCHEDULER_FILE env var is set.  The scheduler can be started using the
      script in this repo:
      "<repo>/python/cugraph_service/scripts/run-dask-process.sh scheduler
      workers"
      """
      from cugraph_service_client import CugraphServiceClient
      from cugraph_service_client.exceptions import CugraphServiceError
  
      server_process = None
      host = "0.0.0.0"
      port = 9090
      client = CugraphServiceClient(host, port)
  
      try:
          client.uptime()
          print(
              "FOUND RUNNING SERVER, ASSUMING IT SHOULD BE USED FOR TESTING!"
          )
          yield
  
      except CugraphServiceError:
          # A server was not found, so start one for testing then stop it when
          # testing is done.
  
          dask_scheduler_file = os.environ.get("SCHEDULER_FILE")
          start_local_cuda_cluster = False
          if dask_scheduler_file is None:
              start_local_cuda_cluster = True
          else:
              dask_scheduler_file = Path(dask_scheduler_file)
              if not dask_scheduler_file.exists():
                  raise FileNotFoundError(
                      "env var SCHEDULER_FILE is set to "
                      f"{dask_scheduler_file}, which does not "
                      "exist."
                  )
  
          server_process = utils.start_server_subprocess(
              host=host,
              port=port,
              start_local_cuda_cluster=start_local_cuda_cluster,
              dask_scheduler_file=dask_scheduler_file,
          )
  
          # yield control to the tests, cleanup on return
          yield
  
          print("\nTerminating server...", end="", flush=True)
          server_process.terminate()
          server_process.wait(timeout=60)
          print("done.", flush=True)
  
imports: import os
  from pathlib import Path
  import pytest
  import cupy
  from cugraph_service_server.testing import utils
  from .None import data
label_desc: Use image node_id 1 for calling a global function with example usage: mg_server() without return types