code: def generate_dense_hete_dataset(add_edge_type=True):
      G = nx.DiGraph()
      num_node = 20
      node_label_options = [0, 1, 2, 3]
      edge_label_options = [0, 1, 2]
      for i in range(num_node):
          node_feature = torch.rand(
              [
                  1,
              ]
          )
          if i < 10:
              node_type = "n1"
          else:
              node_type = "n2"
          node_label = random.choice(node_label_options)
          G.add_node(
              i,
              node_type=node_type,
              node_label=node_label,
              node_feature=node_feature,
          )
  
      if add_edge_type:
          for i, j in itertools.permutations(range(num_node), 2):
              rand = np.random.random()
              if rand > 0.8:
                  continue
              elif rand > 0.4:
                  edge_type = "e1"
              else:
                  edge_type = "e2"
  
              edge_label = random.choice(edge_label_options)
  
              G.add_edge(
                  i,
                  j,
                  edge_feature=torch.rand(
                      [
                          1,
                      ]
                  ),
                  edge_label=edge_label,
                  edge_type=edge_type,
              )
      else:
          for i, j in itertools.permutations(range(num_node), 2):
              rand = np.random.random()
              if rand > 0.8:
                  continue
              elif rand > 0.4:
                  edge_label = 0
              else:
                  edge_label = 1
  
              G.add_edge(
                  i,
                  j,
                  edge_feature=torch.rand(
                      [
                          1,
                      ]
                  ),
                  edge_label=edge_label,
              )
      return G
  
imports: import numpy
  import networkx
  import random
  import torch
  import itertools
label_desc: Use image node_id 16 for calling a global function with example usage: generate_dense_hete_dataset(add_edge_type) and returns: G