code: def test_lightning_hetero_link_data():
      torch.manual_seed(12345)
  
      data = HeteroData()
  
      data["paper"].x = torch.arange(10)
      data["author"].x = torch.arange(10)
      data["term"].x = torch.arange(10)
  
      data["paper", "author"].edge_index = get_random_edge_index(
          10, 10, 10
      )
      data["author", "paper"].edge_index = get_random_edge_index(
          10, 10, 10
      )
      data["paper", "term"].edge_index = get_random_edge_index(
          10, 10, 10
      )
      data["author", "term"].edge_index = get_random_edge_index(
          10, 10, 10
      )
  
      datamodule = LightningLinkData(
          data,
          input_train_edges=("author", "paper"),
          input_val_edges=("paper", "author"),
          input_test_edges=("paper", "term"),
          input_pred_edges=("author", "term"),
          loader="neighbor",
          num_neighbors=[5],
          batch_size=32,
          num_workers=0,
      )
  
      assert isinstance(datamodule.graph_sampler, NeighborSampler)
      assert isinstance(datamodule.eval_graph_sampler, NeighborSampler)
  
      for batch in datamodule.train_dataloader():
          assert "edge_label_index" in batch["author", "paper"]
      for batch in datamodule.val_dataloader():
          assert "edge_label_index" in batch["paper", "author"]
      for batch in datamodule.test_dataloader():
          assert "edge_label_index" in batch["paper", "term"]
      for batch in datamodule.predict_dataloader():
          assert "edge_label_index" in batch["author", "term"]
  
      data["author"].time = torch.arange(data["author"].num_nodes)
      data["paper"].time = torch.arange(data["paper"].num_nodes)
      data["term"].time = torch.arange(data["term"].num_nodes)
  
      datamodule = LightningLinkData(
          data,
          input_train_edges=("author", "paper"),
          input_train_time=torch.arange(
              data["author", "paper"].num_edges
          ),
          loader="neighbor",
          num_neighbors=[5],
          batch_size=32,
          num_workers=0,
          time_attr="time",
      )
  
      for batch in datamodule.train_dataloader():
          assert "edge_label_index" in batch["author", "paper"]
          assert "edge_label_time" in batch["author", "paper"]
  
imports: import math
  import pytest
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.data.lightning import LightningDataset, LightningLinkData, LightningNodeData
  from torch_geometric.nn import global_mean_pool
  from torch_geometric.sampler import BaseSampler, NeighborSampler
  from torch_geometric.testing import MyFeatureStore, MyGraphStore, get_random_edge_index, onlyCUDA, onlyFullTest, onlyNeighborSampler, onlyOnline, withPackage
label_desc: Use image node_id 5 for calling a global function with example usage: test_lightning_hetero_link_data() without return types