code: def test_rooted_rw_subgraph():
      edge_index = torch.tensor([[0, 1, 1, 2], [1, 0, 2, 1]])
      data = Data(edge_index=edge_index, num_nodes=3)
  
      transform = RootedRWSubgraph(walk_length=1)
      assert str(transform) == "RootedRWSubgraph(walk_length=1)"
  
      out = transform(data)
      assert len(out) == 7
  
      assert out.n_sub_batch.tolist() == [0, 0, 1, 1, 2, 2]
      assert out.sub_edge_index.size() == (2, 6)
  
      out = out.map_data()
      assert len(out) == 3
  
      assert out.edge_index.size() == (2, 6)
      assert out.num_nodes == 6
      assert out.n_sub_batch.tolist() == [0, 0, 1, 1, 2, 2]
  
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 2 for calling a global function with example usage: test_rooted_rw_subgraph() without return types