code: def test_sampling_homogenous():
      src_ar = np.asarray(
          [0, 1, 2, 0, 1, 2, 7, 9, 10, 11], dtype=np.int32
      )
      dst_ar = np.asarray(
          [3, 4, 5, 6, 7, 8, 6, 6, 6, 6], dtype=np.int32
      )
      g = dgl.heterograph({("a", "connects", "a"): (src_ar, dst_ar)})
      cugraph_gs = cugraph_dgl.cugraph_storage_from_heterograph(g)
      # Convert to homogeneous
      g = dgl.to_homogeneous(g)
      nodes = [6]
      # Test for multiple fanouts
      for fanout in [1, 2, 3]:
          exp_g = g.sample_neighbors(nodes, fanout=fanout)
          cu_g = cugraph_gs.sample_neighbors(nodes, fanout=fanout)
          exp_src, exp_dst = exp_g.edges()
          cu_src, cu_dst = cu_g.edges()
          assert len(exp_src) == len(cu_src)
  
      # Test same results for all neighbours
      exp_g = g.sample_neighbors(nodes, fanout=-1)
      cu_g = cugraph_gs.sample_neighbors(nodes, fanout=-1)
      exp_src, exp_dst = exp_g.edges()
      exp_src, exp_dst = exp_src.numpy(), exp_dst.numpy()
  
      cu_src, cu_dst = cu_g.edges()
      cu_src, cu_dst = (
          cu_src.to("cpu").numpy(),
          cu_dst.to("cpu").numpy(),
      )
  
      # Assert same values sorted by src
      exp_src_perm = exp_src.argsort()
      exp_src = exp_src[exp_src_perm]
      exp_dst = exp_dst[exp_src_perm]
  
      cu_src_perm = cu_src.argsort()
      cu_src = cu_src[cu_src_perm]
      cu_dst = cu_dst[cu_src_perm]
  
      np.testing.assert_equal(exp_dst, cu_dst)
      np.testing.assert_equal(exp_src, cu_src)
  
file_path: cugraph/python/cugraph-dgl/tests/test_cugraph_storage.py
imports: import pytest
  from cugraph.utilities.utils import import_optional
  import cudf
  import numpy
  from cugraph_dgl import CuGraphStorage
  from .utils import assert_same_sampling_len
label_desc: Use image node_id 4 for calling a global function with example usage: test_sampling_homogenous() without return types