code: def check_random_walks_padded(
      G, path_data, seeds, max_depth, legacy_result_type=True
  ):
      invalid_edge = 0
      invalid_seeds = 0
      invalid_edge_wgt = 0
      v_paths = path_data[0]
      e_wgt_paths = path_data[1]
      e_wgt_idx = 0
  
      G, _ = ensure_cugraph_obj_for_nx(G, nx_weight_attr="wgt")
      df_G = G.input_df
  
      if "weight" in df_G.columns:
          df_G = df_G.rename(columns={"weight": "wgt"})
  
      total_depth = (max_depth) * len(seeds)
  
      for i in range(total_depth - 1):
          vertex_1, vertex_2 = v_paths.iloc[i], v_paths.iloc[i + 1]
  
          # Every max_depth'th vertex in 'v_paths' is a seed
          # instead of 'seeds[i // (max_depth)]', could have just pop the first element
          # of the seeds array once there is a match and compare it to 'vertex_1'
          if (
              i % (max_depth) == 0
              and vertex_1 != seeds[i // (max_depth)]
          ):
              invalid_seeds += 1
              print(
                  "[ERR] Invalid seed: "
                  " src {} != src {}".format(
                      vertex_1, seeds[i // (max_depth)]
                  )
              )
  
          if (i % (max_depth)) != (max_depth - 1):
              # These are the edges
              src = vertex_1
              dst = vertex_2
  
              if src != -1 and dst != -1:
                  # check for valid edge.
                  edge = df_G.loc[
                      (df_G["src"] == (src)) & (df_G["dst"] == (dst))
                  ].reset_index(drop=True)
  
                  if len(edge) == 0:
                      print(
                          "[ERR] Invalid edge: "
                          "There is no edge src {} dst {}".format(
                              src, dst
                          )
                      )
                      invalid_edge += 1
  
                  else:
                      # check valid edge wgt
                      if G.is_weighted():
                          expected_wgt = edge["wgt"].iloc[0]
                          result_wgt = e_wgt_paths.iloc[e_wgt_idx]
  
                          if expected_wgt != result_wgt:
                              print(
                                  "[ERR] Invalid edge wgt: "
                                  "The edge src {} dst {} has wgt {} but got {}".format(
                                      src, dst, expected_wgt, result_wgt
                                  )
                              )
                              invalid_edge_wgt += 1
              e_wgt_idx += 1
  
              if src != -1 and dst == -1:
                  # ensure there is no outgoing edges from 'src'
                  assert G.out_degree([src])["degree"].iloc[0] == 0
  
      assert invalid_seeds == 0
      assert invalid_edge == 0
      assert len(v_paths) == (max_depth) * len(seeds)
      if G.is_weighted():
          assert invalid_edge_wgt == 0
          assert len(e_wgt_paths) == (max_depth - 1) * len(seeds)
  
      if legacy_result_type:
          sizes = path_data[2]
          assert sizes is None
      else:
          max_path_lenth = path_data[2]
          assert max_path_lenth == max_depth - 1
  
file_path: cugraph/python/cugraph/cugraph/tests/sampling/test_random_walks.py
imports: import gc
  import random
  import pytest
  import networkx
  import cudf
  import cugraph
  from cudf.testing import assert_series_equal
  from cugraph.utilities import ensure_cugraph_obj_for_nx
  from cugraph.testing import SMALL_DATASETS, DEFAULT_DATASETS
label_desc: Use image node_id 4 for calling a global function with example usage: check_random_walks_padded(G, path_data, seeds, max_depth, legacy_result_type) without return types