code: def test_hetero_neighbor_loader_sampled_info():
      edge_index = torch.tensor(
          [
              [2, 3, 4, 5, 7, 7, 10, 11, 12, 13],
              [0, 1, 2, 3, 2, 3, 7, 7, 7, 7],
          ]
      )
  
      data = HeteroData()
      data["paper"].num_nodes = data["author"].num_nodes = 14
      data["paper", "paper"].edge_index = edge_index
      data["paper", "author"].edge_index = edge_index
      data["author", "paper"].edge_index = edge_index
  
      loader = NeighborLoader(
          data,
          num_neighbors=[1, 2, 4],
          batch_size=2,
          input_nodes="paper",
          shuffle=False,
      )
      batch = next(iter(loader))
  
      expected_num_sampled_nodes = {
          "paper": [2, 2, 3, 4],
          "author": [0, 2, 3, 4],
      }
      expected_num_sampled_edges = {
          ("paper", "to", "paper"): [2, 4, 4],
          ("paper", "to", "author"): [0, 4, 4],
          ("author", "to", "paper"): [2, 4, 4],
      }
  
      for node_type in batch.node_types:
          assert (
              batch[node_type].num_sampled_nodes
              == expected_num_sampled_nodes[node_type]
          )
      for edge_type in batch.edge_types:
          assert (
              batch[edge_type].num_sampled_edges
              == expected_num_sampled_edges[edge_type]
          )
  
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 14 for calling a global function with example usage: test_hetero_neighbor_loader_sampled_info() without return types