code: def graphs(request):
      with NamedTemporaryFile(mode="w+", suffix=".csv") as graph_tf:
          graph_tf.writelines(request.param)
          graph_tf.seek(0)
  
          cudf_df = cudf.read_csv(
              graph_tf.name,
              names=["src", "dst", "data"],
              delimiter=",",
              dtype=["int32", "int32", "float64"],
          )
          cugraph_G = cugraph.Graph()
          cugraph_G.from_cudf_edgelist(
              cudf_df, source="src", destination="dst", edge_attr="data"
          )
  
          # construct cupy coo_matrix graph
          i = []
          j = []
          weights = []
          for index in range(cudf_df.shape[0]):
              vertex1 = cudf_df.iloc[index]["src"]
              vertex2 = cudf_df.iloc[index]["dst"]
              weight = cudf_df.iloc[index]["data"]
              i += [vertex1, vertex2]
              j += [vertex2, vertex1]
              weights += [weight, weight]
          i = cupy.array(i)
          j = cupy.array(j)
          weights = cupy.array(weights)
          largest_vertex = max(cupy.amax(i), cupy.amax(j))
          cupy_df = cupy_coo_matrix(
              (weights, (i, j)),
              shape=(largest_vertex + 1, largest_vertex + 1),
          )
  
          yield cugraph_G, cupy_df
  
file_path: cugraph/python/cugraph/cugraph/tests/traversal/test_paths.py
imports: import sys
  from tempfile import NamedTemporaryFile
  import math
  import numpy
  import pytest
  import cudf
  import cupy
  import cugraph
  from cugraph.testing import get_resultset, load_resultset
  from cupyx.scipy.sparse import coo_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: graphs(request) without return types