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