code: def load_training_data(f_name):
      print("We are loading data from:", f_name)
      edge_data_by_type = dict()
      all_nodes = list()
      with open(f_name, "r") as f:
          for line in f:
              words = line[:-1].split(" ")  # line[-1] == '\n'
              if words[0] not in edge_data_by_type:
                  edge_data_by_type[words[0]] = list()
              x, y = words[1], words[2]
              edge_data_by_type[words[0]].append((x, y))
              all_nodes.append(x)
              all_nodes.append(y)
      all_nodes = list(set(all_nodes))
      print("Total training nodes: " + str(len(all_nodes)))
      return edge_data_by_type
  
file_path: dgl/examples/pytorch/GATNE-T/src/utils.py
imports: import argparse
  import multiprocessing
  import time
  from collections import defaultdict
  from functools import partial, reduce, wraps
  import networkx
  import numpy
  import torch
  from gensim.models.keyedvectors import Vocab
  from six import iteritems
  from sklearn.metrics import auc, f1_score, precision_recall_curve, roc_auc_score
label_desc: Use image node_id 2 for calling a global function with example usage: load_training_data(f_name) and returns: edge_data_by_type