code: def test_rooted_subgraph_minibatch():
      x = torch.randn(3, 8)
      edge_index = torch.tensor([[0, 1, 1, 2], [1, 0, 2, 1]])
      edge_attr = torch.randn(4, 8)
      data = Data(x=x, edge_index=edge_index, edge_attr=edge_attr)
  
      transform = RootedEgoNets(num_hops=1)
      data = transform(data)
  
      loader = DataLoader([data, data], batch_size=2)
      batch = next(iter(loader))
      batch = batch.map_data()
      assert batch.num_graphs == len(batch) == 2
  
      assert batch.x.size() == (14, 8)
      assert batch.edge_index.size() == (2, 16)
      assert batch.edge_attr.size() == (16, 8)
      assert batch.n_sub_batch.size() == (14,)
      assert batch.batch.size() == (14,)
      assert batch.ptr.size() == (3,)
  
      assert batch.edge_index.min() == 0
      assert batch.edge_index.max() == 13
  
      assert batch.n_sub_batch.min() == 0
      assert batch.n_sub_batch.max() == 5
  
imports: import torch
  from torch_geometric.data import Data
  from torch_geometric.loader import DataLoader
  from torch_geometric.testing import withPackage
  from torch_geometric.transforms import RootedEgoNets, RootedRWSubgraph
label_desc: Use image node_id 3 for calling a global function with example usage: test_rooted_subgraph_minibatch() without return types