code: def test_pyg_lib_and_torch_sparse_hetero_equality():
      edge_index = get_random_edge_index(20, 10, 50)
      adj = to_torch_csr_tensor(edge_index.flip([0]), size=(10, 20))
      colptr1, row1 = adj.crow_indices(), adj.col_indices()
  
      edge_index = get_random_edge_index(10, 20, 50)
      adj = to_torch_csr_tensor(edge_index.flip([0]), size=(20, 10))
      colptr2, row2 = adj.crow_indices(), adj.col_indices()
  
      node_types = ["paper", "author"]
      edge_types = [
          ("paper", "to", "author"),
          ("author", "to", "paper"),
      ]
      colptr_dict = {
          "paper__to__author": colptr1,
          "author__to__paper": colptr2,
      }
      row_dict = {
          "paper__to__author": row1,
          "author__to__paper": row2,
      }
      seed_dict = {"paper": torch.arange(1)}
      num_neighbors_dict = {
          "paper__to__author": [-1, -1],
          "author__to__paper": [-1, -1],
      }
  
      sample = torch.ops.pyg.hetero_neighbor_sample
      out1 = sample(
          node_types,
          edge_types,
          colptr_dict,
          row_dict,
          seed_dict,
          num_neighbors_dict,
          None,
          None,
          None,
          None,
          True,
          False,
          True,
          False,
          "uniform",
          True,
      )
      sample = torch.ops.torch_sparse.hetero_neighbor_sample
      out2 = sample(
          node_types,
          edge_types,
          colptr_dict,
          row_dict,
          seed_dict,
          num_neighbors_dict,
          2,
          False,
          True,
      )
  
      row1_dict, col1_dict, node_id1_dict, edge_id1_dict = out1[:4]
      node_id2_dict, row2_dict, col2_dict, edge_id2_dict = out2
      assert len(node_id1_dict) == len(node_id2_dict)
      for key in node_id1_dict.keys():
          assert torch.equal(node_id1_dict[key], node_id2_dict[key])
      assert len(row1_dict) == len(row2_dict)
      for key in row1_dict.keys():
          assert torch.equal(row1_dict[key], row2_dict[key])
      assert len(col1_dict) == len(col2_dict)
      for key in col1_dict.keys():
          assert torch.equal(col1_dict[key], col2_dict[key])
      assert len(edge_id1_dict) == len(edge_id2_dict)
      for key in edge_id1_dict.keys():
          assert torch.equal(edge_id1_dict[key], edge_id2_dict[key])
  
imports: import os.path
  import numpy
  import pytest
  import torch
  import torch_geometric.typing
  from torch_geometric import EdgeIndex
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.loader import NeighborLoader
  from torch_geometric.nn import GraphConv, to_hetero
  from torch_geometric.sampler.base import SubgraphType
  from torch_geometric.testing import MyFeatureStore, MyGraphStore, get_random_edge_index, get_random_tensor_frame, onlyLinux, onlyNeighborSampler, onlyOnline, withCUDA, withPackage
  from torch_geometric.typing import WITH_EDGE_TIME_NEIGHBOR_SAMPLE, WITH_PYG_LIB, WITH_TORCH_SPARSE, WITH_WEIGHTED_NEIGHBOR_SAMPLE, TensorFrame
  from torch_geometric.utils import is_undirected, sort_edge_index, to_torch_csr_tensor, to_undirected
label_desc: Use image node_id 11 for calling a global function with example usage: test_pyg_lib_and_torch_sparse_hetero_equality() without return types