code: def create_test_heterograph(num_nodes, num_adj, idtype):
      if isinstance(num_adj, int):
          num_adj = [num_adj, num_adj + 1]
      num_adj_list = list(
          np.random.choice(np.arange(num_adj[0], num_adj[1]), num_nodes)
      )
      src = np.concatenate(
          [[i] * num_adj_list[i] for i in range(num_nodes)]
      )
      dst = [
          np.random.choice(num_nodes, nadj, replace=False)
          for nadj in num_adj_list
      ]
      dst = np.concatenate(dst)
      return dgl.graph((src, dst), idtype=idtype)
  
file_path: dgl/tests/python/common/transforms/test_functional-sort.py
imports: import itertools
  import unittest
  from collections import Counter
  import backend
  import dgl
  import dgl.function
  import networkx
  import numpy
  import pytest
  import scipy.sparse
  from dgl import DGLError
  from utils import parametrize_idtype
label_desc: Use image node_id 1 for calling a global function with example usage: create_test_heterograph(num_nodes, num_adj, idtype) and returns: dgl