code: def test_add_remaining_self_loops_all_loops_exist():
      # All self-loops already exist in the data object.
      edge_index = torch.tensor([[0, 1, 2], [0, 1, 2]])
      data = Data(edge_index=edge_index, num_nodes=3)
      data = AddRemainingSelfLoops()(data)
      assert data.edge_index.tolist() == edge_index.tolist()
  
      # All self-loops already exist in the data object, some of them appear
      # multiple times.
      edge_index = torch.tensor([[0, 0, 1, 1, 2], [0, 0, 1, 1, 2]])
      data = Data(edge_index=edge_index, num_nodes=3)
      data = AddRemainingSelfLoops()(data)
      assert data.edge_index.tolist() == [[0, 1, 2], [0, 1, 2]]
  
imports: import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.transforms import AddRemainingSelfLoops
label_desc: Use image node_id 2 for calling a global function with example usage: test_add_remaining_self_loops_all_loops_exist() without return types