code: def to_undirected(edge_index):
      row, col = edge_index.transpose(1, 0)
      row, col = torch.cat([row, col], dim=0), torch.cat(
          [col, row], dim=0
      )
      edge_index = torch.stack([row, col], dim=0)
  
      return edge_index.transpose(1, 0).tolist()
  
file_path: dgl/examples/pytorch/ogb/directional_GSN/preprocessing.py
imports: import os
  import graph_tool
  import graph_tool.topology
  import networkx
  import numpy
  import torch
  from dgl.data.utils import load_graphs, save_graphs
  from ogb.graphproppred import DglGraphPropPredDataset
  from tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: to_undirected(edge_index) and returns: edge_index