code: def test_to_undirected():
      row = torch.tensor([0, 1, 1])
      col = torch.tensor([1, 0, 2])
  
      edge_index = to_undirected(torch.stack([row, col], dim=0))
      assert edge_index.tolist() == [[0, 1, 1, 2], [1, 0, 2, 1]]
  
      @torch.jit.script
      def jit(edge_index: Tensor) -> Tensor:
          return to_undirected(edge_index)
  
      assert torch.equal(
          jit(torch.stack([row, col], dim=0)), edge_index
      )
  
imports: import torch
  from torch import Tensor
  from torch_geometric.utils import is_undirected, to_undirected
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_undirected() and returns: to_undirected