code: def _gen_neighbor_topk_test_graph(hypersparse, reverse):
      if hypersparse:
          # should crash if allocated a CSR
          card = 1 << 50
      else:
          card = None
  
      if reverse:
          g = dgl.heterograph(
              {
                  ("user", "follow", "user"): (
                      [0, 0, 0, 1, 1, 1, 2],
                      [1, 2, 3, 0, 2, 3, 0],
                  )
              }
          )
          g.edata["weight"] = F.tensor(
              [0.5, 0.3, 0.0, -5.0, 22.0, 0.0, 1.0], dtype=F.float32
          )
          hg = dgl.heterograph(
              {
                  ("user", "follow", "user"): (
                      [0, 0, 0, 1, 1, 1, 2],
                      [1, 2, 3, 0, 2, 3, 0],
                  ),
                  ("game", "play", "user"): (
                      [0, 1, 2, 2],
                      [0, 0, 1, 3],
                  ),
                  ("user", "liked-by", "game"): (
                      [0, 1, 2, 0, 3, 0],
                      [2, 2, 2, 1, 1, 0],
                  ),
                  ("coin", "flips", "user"): (
                      [0, 0, 0, 0],
                      [0, 1, 2, 3],
                  ),
              }
          )
      else:
          g = dgl.heterograph(
              {
                  ("user", "follow", "user"): (
                      [1, 2, 3, 0, 2, 3, 0],
                      [0, 0, 0, 1, 1, 1, 2],
                  )
              }
          )
          g.edata["weight"] = F.tensor(
              [0.5, 0.3, 0.0, -5.0, 22.0, 0.0, 1.0], dtype=F.float32
          )
          hg = dgl.heterograph(
              {
                  ("user", "follow", "user"): (
                      [1, 2, 3, 0, 2, 3, 0],
                      [0, 0, 0, 1, 1, 1, 2],
                  ),
                  ("user", "play", "game"): (
                      [0, 0, 1, 3],
                      [0, 1, 2, 2],
                  ),
                  ("game", "liked-by", "user"): (
                      [2, 2, 2, 1, 1, 0],
                      [0, 1, 2, 0, 3, 0],
                  ),
                  ("user", "flips", "coin"): (
                      [0, 1, 2, 3],
                      [0, 0, 0, 0],
                  ),
              }
          )
      hg.edges["follow"].data["weight"] = F.tensor(
          [0.5, 0.3, 0.0, -5.0, 22.0, 0.0, 1.0], dtype=F.float32
      )
      hg.edges["play"].data["weight"] = F.tensor(
          [0.8, 0.5, 0.4, 0.5], dtype=F.float32
      )
      hg.edges["liked-by"].data["weight"] = F.tensor(
          [0.3, 0.5, 0.2, 0.5, 0.1, 0.1], dtype=F.float32
      )
      hg.edges["flips"].data["weight"] = F.tensor(
          [10, 2, 13, -1], dtype=F.float32
      )
      return g, hg
  
imports: import unittest
  import warnings
  import backend
  import dgl
  import numpy
  import pytest
label_desc: Use image node_id 8 for calling a global function with example usage: _gen_neighbor_topk_test_graph(hypersparse, reverse) and returns: g,  hg