code: def test_to_undirected_with_duplicates():
      edge_index = torch.tensor([[0, 0, 1, 1], [0, 1, 0, 2]])
      edge_weight = torch.ones(4)
  
      data = Data(
          edge_index=edge_index, edge_weight=edge_weight, num_nodes=3
      )
      data = ToUndirected()(data)
      assert len(data) == 3
      assert data.edge_index.tolist() == [
          [0, 0, 1, 1, 2],
          [0, 1, 0, 2, 1],
      ]
      assert data.edge_weight.tolist() == [2, 2, 2, 1, 1]
      assert data.num_nodes == 3
  
imports: import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.transforms import ToUndirected
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_undirected_with_duplicates() without return types