code: def test_pair_data_batching():
      class PairData(Data):
          def __inc__(self, key, value, *args, **kwargs):
              if key == "edge_index_s":
                  return self.x_s.size(0)
              if key == "edge_index_t":
                  return self.x_t.size(0)
              return super().__inc__(key, value, *args, **kwargs)
  
      x_s = torch.randn(5, 16)
      edge_index_s = torch.tensor(
          [
              [0, 0, 0, 0],
              [1, 2, 3, 4],
          ]
      )
      x_t = torch.randn(4, 16)
      edge_index_t = torch.tensor(
          [
              [0, 0, 0],
              [1, 2, 3],
          ]
      )
  
      data = PairData(
          x_s=x_s,
          edge_index_s=edge_index_s,
          x_t=x_t,
          edge_index_t=edge_index_t,
      )
      batch = Batch.from_data_list([data, data])
  
      assert torch.allclose(batch.x_s, torch.cat([x_s, x_s], dim=0))
      assert batch.edge_index_s.tolist() == [
          [0, 0, 0, 0, 5, 5, 5, 5],
          [1, 2, 3, 4, 6, 7, 8, 9],
      ]
  
      assert torch.allclose(batch.x_t, torch.cat([x_t, x_t], dim=0))
      assert batch.edge_index_t.tolist() == [
          [0, 0, 0, 4, 4, 4],
          [1, 2, 3, 5, 6, 7],
      ]
  
imports: import os.path
  import numpy
  import pytest
  import torch
  import torch_geometric
  from torch_geometric import EdgeIndex
  from torch_geometric.data import Batch, Data, HeteroData
  from torch_geometric.testing import get_random_edge_index, withPackage
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import to_edge_index, to_torch_sparse_tensor
label_desc: Use image node_id 10 for calling a global function with example usage: test_pair_data_batching() and returns: super, self, self