code: def generate_dense_hete_graph(add_edge_type=True, directed=True):
      if directed:
          G = nx.DiGraph()
      else:
          G = nx.Graph()
      num_node = 20
      for i in range(num_node):
          if i < 10:
              node_feature = torch.rand(
                  [
                      10,
                  ]
              )
              node_type = "n1"
              node_label = 0
              G.add_node(
                  i,
                  node_type=node_type,
                  node_label=node_label,
                  node_feature=node_feature,
              )
          else:
              node_feature = torch.rand(
                  [
                      12,
                  ]
              )
              node_type = "n2"
              node_label = 1
              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:
                  G.add_edge(
                      i,
                      j,
                      edge_label=0,
                      edge_feature=torch.rand(
                          [
                              8,
                          ]
                      ),
                      edge_type="e1",
                  )
              else:
                  G.add_edge(
                      i,
                      j,
                      edge_label=0,
                      edge_feature=torch.rand(
                          [
                              8,
                          ]
                      ),
                      edge_type="e2",
                  )
      else:
          for i, j in itertools.permutations(range(num_node), 2):
              rand = np.random.random()
              if rand > 0.8:
                  continue
              elif rand > 0.4:
                  G.add_edge(
                      i,
                      j,
                      edge_label=0,
                      edge_feature=torch.rand(
                          [
                              8,
                          ]
                      ),
                  )
              else:
                  G.add_edge(
                      i,
                      j,
                      edge_label=0,
                      edge_feature=torch.rand(
                          [
                              8,
                          ]
                      ),
                  )
      return G
  
imports: import numpy
  import networkx
  import random
  import torch
  import itertools
label_desc: Use image node_id 15 for calling a global function with example usage: generate_dense_hete_graph(add_edge_type, directed) and returns: G