code: def test_temporal_hetero_link_neighbor_loader():
      data = HeteroData()
  
      data["paper"].x = torch.arange(100)
      data["paper"].time = torch.arange(data["paper"].num_nodes) - 200
      data["author"].x = torch.arange(100, 300)
      data["author"].time = torch.arange(data["author"].num_nodes)
  
      data["paper", "paper"].edge_index = get_random_edge_index(
          100, 100, 500
      )
      data["paper", "author"].edge_index = get_random_edge_index(
          100, 200, 1000
      )
      data["author", "paper"].edge_index = get_random_edge_index(
          200, 100, 1000
      )
  
      with pytest.raises(
          ValueError, match=r"'edge_label_time' is not set"
      ):
          loader = LinkNeighborLoader(
              data,
              num_neighbors=[-1] * 2,
              edge_label_index=("paper", "paper"),
              batch_size=32,
              time_attr="time",
          )
  
      # With edge_time:
      edge_time = torch.arange(
          data["paper", "paper"].edge_index.size(1)
      )
      loader = LinkNeighborLoader(
          data,
          num_neighbors=[-1] * 2,
          edge_label_index=("paper", "paper"),
          edge_label_time=edge_time,
          batch_size=32,
          time_attr="time",
          neg_sampling_ratio=0.5,
          drop_last=True,
      )
      for batch in loader:
          # Check if each seed edge has a different batch:
          assert int(batch["paper"].batch.max()) + 1 == 32
  
          author_max = batch["author"].time.max()
          edge_max = batch["paper", "paper"].edge_label_time.max()
          assert edge_max >= author_max
          author_min = batch["author"].time.min()
          edge_min = batch["paper", "paper"].edge_label_time.min()
          assert edge_min >= author_min
  
file_path: pytorch_geometric/test/loader/test_link_neighbor_loader.py
imports: import pytest
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.loader import LinkNeighborLoader
  from torch_geometric.testing import MyFeatureStore, MyGraphStore, get_random_edge_index, onlyNeighborSampler, withCUDA, withPackage
label_desc: Use image node_id 7 for calling a global function with example usage: test_temporal_hetero_link_neighbor_loader() without return types