code: def split_data(hg, etype_name):
      src, dst = hg.edges(etype=etype_name)
      user_item_src = src.numpy().tolist()
      user_item_dst = dst.numpy().tolist()
  
      num_link = len(user_item_src)
      pos_label = [1] * num_link
      pos_data = list(zip(user_item_src, user_item_dst, pos_label))
  
      ui_adj = np.array(hg.adj_external(etype=etype_name).to_dense())
      full_idx = np.where(ui_adj == 0)
  
      sample = random.sample(range(0, len(full_idx[0])), num_link)
      neg_label = [0] * num_link
      neg_data = list(
          zip(full_idx[0][sample], full_idx[1][sample], neg_label)
      )
  
      full_data = pos_data + neg_data
      random.shuffle(full_data)
  
      train_size = int(len(full_data) * 0.6)
      eval_size = int(len(full_data) * 0.2)
      test_size = len(full_data) - train_size - eval_size
      train_data = full_data[:train_size]
      eval_data = full_data[train_size : train_size + eval_size]
      test_data = full_data[
          train_size + eval_size : train_size + eval_size + test_size
      ]
      train_data = np.array(train_data)
      eval_data = np.array(eval_data)
      test_data = np.array(test_data)
  
      return train_data, eval_data, test_data
  
file_path: dgl/examples/pytorch/TAHIN/data_loader.py
imports: import os
  import pickle
  import random
  import dgl
  import numpy
  import torch
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 1 for calling a global function with example usage: split_data(hg, etype_name) and returns: train_data,  eval_data,  test_data