code: def test_khop_adj():
      N = 20
      feat = F.randn((N, 5))
      g = dgl.from_networkx(nx.erdos_renyi_graph(N, 0.3, directed=True))
      for k in range(3):
          adj = F.tensor(F.swapaxes(dgl.khop_adj(g, k), 0, 1))
          # use original graph to do message passing for k times.
          g.ndata["h"] = feat
          for _ in range(k):
              g.update_all(fn.copy_u("h", "m"), fn.sum("m", "h"))
          h_0 = g.ndata.pop("h")
          # use k-hop adj to do message passing for one time.
          h_1 = F.matmul(adj, feat)
          assert F.allclose(h_0, h_1, rtol=1e-3, atol=1e-3)
  
imports: import math
  import os
  import unittest
  import backend
  import dgl
  import dgl.function
  import dgl.partition
  import networkx
  import numpy
  import pytest
  from scipy import sparse
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases
label_desc: Use image node_id 14 for calling a global function with example usage: test_khop_adj() without return types