code: def create_etype_test_graph(num_nodes, num_edges_per_node, rare_cnt):
      src = np.concatenate(
          [
              np.random.choice(
                  num_nodes, num_edges_per_node, replace=False
              )
              for i in range(num_nodes)
          ]
      )
      dst = np.concatenate(
          [np.array([i] * num_edges_per_node) for i in range(num_nodes)]
      )
  
      minor_src = np.concatenate(
          [
              np.random.choice(num_nodes, 2, replace=False)
              for i in range(num_nodes)
          ]
      )
      minor_dst = np.concatenate(
          [np.array([i] * 2) for i in range(num_nodes)]
      )
  
      most_zero_src = np.concatenate(
          [
              np.random.choice(
                  num_nodes, num_edges_per_node, replace=False
              )
              for i in range(rare_cnt)
          ]
      )
      most_zero_dst = np.concatenate(
          [np.array([i] * num_edges_per_node) for i in range(rare_cnt)]
      )
  
      g = dgl.heterograph(
          {
              ("v", "e_major", "u"): (src, dst),
              ("u", "e_major_rev", "v"): (dst, src),
              ("v2", "e_minor", "u"): (minor_src, minor_dst),
              ("v2", "most_zero", "u"): (most_zero_src, most_zero_dst),
              ("u", "e_minor_rev", "v2"): (minor_dst, minor_src),
          }
      )
      for etype in g.etypes:
          prob = np.random.rand(g.num_edges(etype))
          prob[prob > 0.2] = 0
          g.edges[etype].data["p"] = F.zerocopy_from_numpy(prob)
          g.edges[etype].data["mask"] = F.zerocopy_from_numpy(prob != 0)
  
      return g
  
imports: import unittest
  import warnings
  import backend
  import dgl
  import numpy
  import pytest
label_desc: Use image node_id 24 for calling a global function with example usage: create_etype_test_graph(num_nodes, num_edges_per_node, rare_cnt) and returns: g