code: def test_random_walks_coalesced(graph_file, directed):
      max_depth = random.randint(2, 10)
  
      input_graph = graph_file.get_graph(
          create_using=cugraph.Graph(directed=directed)
      )
  
      path_data, seeds = calc_random_walks(
          input_graph, max_depth=max_depth, use_padding=False
      )
      check_random_walks(path_data, seeds, input_graph)
  
      # Check path query output
      df = cugraph.rw_path(len(seeds), path_data[2])
      v_offsets = [0] + path_data[2].cumsum()[:-1].to_numpy().tolist()
      w_offsets = [0] + (path_data[2] - 1).cumsum()[
          :-1
      ].to_numpy().tolist()
  
      assert_series_equal(
          df["weight_sizes"], path_data[2] - 1, check_names=False
      )
      assert df["vertex_offsets"].to_numpy().tolist() == v_offsets
      assert df["weight_offsets"].to_numpy().tolist() == w_offsets
  
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 6 for calling a global function with example usage: test_random_walks_coalesced(graph_file, directed) without return types