code: def random_hetero_graph(num_nodes, num_edges, num_ntypes, num_etypes):
      ntypes, etypes = get_ntypes_and_etypes(
          num_nodes, num_ntypes, num_etypes
      )
      edges = {}
      for step, etype in enumerate(etypes):
          src_ntype, _, dst_ntype = etype
          num_e = num_edges // num_etypes + (
              0 if step != 0 else num_edges % num_etypes
          )
          if ntypes[src_ntype] == 0 or ntypes[dst_ntype] == 0:
              continue
          src = torch.randint(0, ntypes[src_ntype], (num_e,))
          dst = torch.randint(0, ntypes[dst_ntype], (num_e,))
  
          edges[etype] = (src, dst)
  
      gb_g = gb.from_dglgraph(dgl.heterograph(edges, ntypes))
      return (
          gb_g.csc_indptr,
          gb_g.indices,
          gb_g.node_type_offset,
          gb_g.type_per_edge,
          gb_g.node_type_to_id,
          gb_g.edge_type_to_id,
      )
  
file_path: dgl/tests/python/pytorch/graphbolt/gb_test_utils.py
imports: import os
  import dgl
  import dgl.graphbolt
  import numpy
  import pandas
  import scipy.sparse
  import torch
label_desc: Use image node_id 5 for calling a global function with example usage: random_hetero_graph(num_nodes, num_edges, num_ntypes, num_etypes) and returns: gb_g,  gb_g,  gb_g,  gb_g,  gb_g,  gb_g