code: def check_random_walks(G, path_data, seeds, max_depth, df_G=None):
      invalid_edge = 0
      invalid_edge_wgt_path = 0
      invalid_seeds = 0
      next_path_idx = 0
      invalid_edge_wgt_path = 0
      e_wgt_path_idx = 0
      v_paths = path_data[0].compute()
      e_paths = path_data[1].compute()
  
      max_path_length = path_data[2]
      sizes = max_path_length
  
      for _ in range(len(seeds)):
          for i in range(next_path_idx, next_path_idx + sizes):
              src, dst = v_paths.iloc[i], v_paths.iloc[i + 1]
  
              if i == next_path_idx and src not in seeds.values:
                  invalid_seeds += 1
                  print(
                      "[ERR] Invalid seed: "
                      " src {} != src {}".format(src, seeds)
                  )
  
              else:
                  # If everything is good proceed to the next part
                  # now check the destination
  
                  # find the src out_degree to ensure it effectively has no outgoing edges
                  # No need to check for -1 values, move to the next iteration
                  if src != -1:
                      src_degree = G.out_degree([src])[
                          "degree"
                      ].compute()[0]
                      if dst == -1 and src_degree == 0:
                          if e_paths.values[e_wgt_path_idx] != 0:
                              wgt = e_paths.values[e_wgt_path_idx]
                              print(
                                  "[ERR] Invalid edge weight path: "
                                  "Edge src {} dst {} has wgt 0 "
                                  "But got wgt {}".format(src, dst, wgt)
                              )
                              invalid_edge_wgt_path += 1
                      else:
                          exp_edge = df_G.loc[
                              (df_G["src"] == (src))
                              & (df_G["dst"] == (dst))
                          ].reset_index(drop=True)
  
                          if len(exp_edge) == 0:
                              print(
                                  "[ERR] Invalid edge: "
                                  "There is no edge src {} dst {}".format(
                                      src, dst
                                  )
                              )
                              invalid_edge += 1
                          else:
                              # This is a valid edge, check the edge_wgt_path
                              if e_paths.values[e_wgt_path_idx] != 1:
                                  wgt = e_paths.values[e_wgt_path_idx]
                                  print(
                                      "[ERR] Invalid edge weight path: "
                                      "Edge src {} dst {} has wgt 1 "
                                      "But got wgt {}".format(
                                          src, dst, wgt
                                      )
                                  )
                                  invalid_edge_wgt_path += 1
                  else:
                      # v_path: src == -1, dst == -1 => e_wgt_path=0 otherwise ERROR
                      if e_paths.values[e_wgt_path_idx] != 0:
                          wgt = e_paths.values[e_wgt_path_idx]
                          print(
                              "[ERR] Invalid edge weight path: "
                              "Edge src {} dst {} has wgt 0 "
                              "But got wgt {}".format(src, dst, wgt)
                          )
                          invalid_edge_wgt_path += 1
  
              e_wgt_path_idx += 1
          next_path_idx += sizes + 1
  
      assert invalid_edge == 0
      assert invalid_seeds == 0
      assert invalid_edge_wgt_path == 0
      assert max_path_length == max_depth
  
file_path: cugraph/python/cugraph/cugraph/tests/sampling/test_random_walks_mg.py
imports: import gc
  import random
  import pytest
  import cugraph
  import dask_cudf
  import cugraph.dask
  from cugraph.testing import SMALL_DATASETS
  from cugraph.datasets import karate_asymmetric
  from pylibcugraph.testing.utils import gen_fixture_params_product
label_desc: Use image node_id 3 for calling a global function with example usage: check_random_walks(G, path_data, seeds, max_depth, df_G) without return types