code: def get_graph_data_for_dataset(ds, ds_name):
      """
      Given an object representing either a path to a dataset on disk, or an
      object containing raw data, return a series of arrays that can be used to
      construct a graph object. The final value is a bool used to indicate if the
      data is valid or not (invalid to test error handling).
      """
      if isinstance(ds, COOTestGraphDeviceData):
          device_srcs = ds.srcs
          device_dsts = ds.dsts
          device_weights = ds.weights
          is_valid = ds.is_valid
      else:
          pdf = pd.read_csv(
              ds,
              delimiter=" ",
              header=None,
              names=["0", "1", "weight"],
              dtype={"0": "int32", "1": "int32", "weight": "float32"},
          )
          device_srcs = cp.asarray(pdf["0"].to_numpy(), dtype=np.int32)
          device_dsts = cp.asarray(pdf["1"].to_numpy(), dtype=np.int32)
          device_weights = cp.asarray(
              pdf["weight"].to_numpy(), dtype=np.float32
          )
          # Assume all datasets on disk are valid
          is_valid = True
  
      return (
          device_srcs,
          device_dsts,
          device_weights,
          ds_name,
          is_valid,
      )
  
file_path: cugraph/python/pylibcugraph/pylibcugraph/tests/conftest.py
imports: import pandas
  import cupy
  import numpy
  import pytest
  from pylibcugraph.testing import utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_graph_data_for_dataset(ds, ds_name) and returns: device_srcs,  device_dsts,  device_weights,  ds_name,  is_valid