code: def test_sample_neighbors_exclude_edges_homoG(dtype, fused):
      if fused and (
          F._default_context_str == "gpu" or F.backend_name != "pytorch"
      ):
          pytest.skip(
              "Fused sampling support CPU with backend PyTorch."
          )
      u_nodes = F.zerocopy_from_numpy(
          np.unique(np.random.randint(300, size=100, dtype=dtype))
      )
      v_nodes = F.zerocopy_from_numpy(
          np.random.randint(25, size=u_nodes.shape, dtype=dtype)
      )
      g = dgl.graph((u_nodes, v_nodes)).to(F.ctx())
  
      (U, V, EID) = (0, 1, 2)
  
      nd_b_idx = np.random.randint(low=1, high=24, dtype=dtype)
      nd_e_idx = np.random.randint(low=25, high=49, dtype=dtype)
      b_idx = np.random.randint(low=1, high=24, dtype=dtype)
      e_idx = np.random.randint(low=25, high=49, dtype=dtype)
      sampled_amount = np.random.randint(low=1, high=10, dtype=dtype)
  
      g_edges = g.all_edges(form="all")
      excluded_edges = g_edges[EID][b_idx:e_idx]
      sampled_node = g_edges[V][nd_b_idx:nd_e_idx]
      excluded_nodes_U = g_edges[U][b_idx:e_idx]
      excluded_nodes_V = g_edges[V][b_idx:e_idx]
  
      sg = sample_neighbors_fusing_mode[fused](
          g, sampled_node, sampled_amount, exclude_edges=excluded_edges
      )
      if fused:
  
          def contain_edge(g, sg, u, v):
              # set of subgraph graph edges deduced from original graph
              org_edges = set(
                  map(
                      tuple,
                      np.stack(
                          g.find_edges(sg.edges["_E"].data[dgl.EID]),
                          axis=1,
                      ),
                  )
              )
              # set of excluded edges
              excluded_edges = set(map(tuple, np.stack((u, v), axis=1)))
  
              diff_set = org_edges - excluded_edges
  
              return len(diff_set) != len(org_edges)
  
          assert not contain_edge(
              g, sg, excluded_nodes_U, excluded_nodes_V
          )
      else:
          assert not np.any(
              F.asnumpy(
                  sg.has_edges_between(
                      excluded_nodes_U, excluded_nodes_V
                  )
              )
          )
  
imports: import unittest
  import warnings
  import backend
  import dgl
  import numpy
  import pytest
label_desc: Use image node_id 30 for calling a global function with example usage: test_sample_neighbors_exclude_edges_homoG(dtype, fused) and returns: unknown