code: def test_sample_neighbors_return_eids_hetero(labor):
      """
      Original graph in COO:
      "n1:e1:n2":[0, 0, 1, 1, 1], [0, 2, 0, 1, 2]
      "n2:e2:n1":[0, 0, 1, 2], [0, 1, 1 ,0]
      0   0   1   0   1
      0   0   1   1   1
      1   1   0   0   0
      0   1   0   0   0
      1   0   0   0   0
      """
      # Initialize data.
      ntypes = {"n1": 0, "n2": 1}
      etypes = {"n1:e1:n2": 0, "n2:e2:n1": 1}
      total_num_edges = 9
      indptr = torch.LongTensor([0, 2, 4, 6, 7, 9])
      indices = torch.LongTensor([2, 4, 2, 3, 0, 1, 1, 0, 1])
      type_per_edge = torch.LongTensor([1, 1, 1, 1, 0, 0, 0, 0, 0])
      node_type_offset = torch.LongTensor([0, 2, 5])
      edge_attributes = {
          gb.ORIGINAL_EDGE_ID: torch.cat(
              [torch.randperm(4), torch.randperm(5)]
          )
      }
      assert indptr[-1] == total_num_edges
      assert indptr[-1] == len(indices)
  
      # Construct FusedCSCSamplingGraph.
      graph = gb.fused_csc_sampling_graph(
          indptr,
          indices,
          node_type_offset=node_type_offset,
          type_per_edge=type_per_edge,
          edge_attributes=edge_attributes,
          node_type_to_id=ntypes,
          edge_type_to_id=etypes,
      ).to(F.ctx())
  
      # Sample on both node types.
      nodes = {
          "n1": torch.LongTensor([0]).to(F.ctx()),
          "n2": torch.LongTensor([0]).to(F.ctx()),
      }
      fanouts = torch.tensor([-1, -1])
      sampler = (
          graph.sample_layer_neighbors
          if labor
          else graph.sample_neighbors
      )
      subgraph = sampler(nodes, fanouts)
  
      expected_reverse_edge_ids = {
          "n2:e2:n1": graph.edge_attributes[gb.ORIGINAL_EDGE_ID][
              torch.tensor([0, 1], device=F.ctx())
          ],
          "n1:e1:n2": graph.edge_attributes[gb.ORIGINAL_EDGE_ID][
              torch.tensor([4, 5], device=F.ctx())
          ],
      }
      assert subgraph.original_column_node_ids is None
      assert subgraph.original_row_node_ids is None
      for etype in etypes.keys():
          assert torch.equal(
              subgraph.original_edge_ids[etype].sort()[0],
              expected_reverse_edge_ids[etype].sort()[0],
          )
  
imports: import os
  import pickle
  import re
  import tempfile
  import unittest
  import backend
  import dgl
  import dgl.graphbolt
  import pytest
  import torch
  import torch.multiprocessing
  from dgl.graphbolt.base import etype_str_to_tuple
  from scipy import sparse
  from ..None import gb_test_utils
label_desc: Use image node_id 38 for calling a global function with example usage: test_sample_neighbors_return_eids_hetero(labor) without return types