code: def __getitem__(self, idx):
      # return the list of pairs (center, context, 5 negatives)
      while True:
          line = self.input_file.readline()
          if not line:
              self.input_file.seek(0, 0)
              line = self.input_file.readline()
  
          if len(line) > 1:
              words = line.split()
  
              if len(words) > 1:
                  word_ids = [
                      self.data.word2id[w]
                      for w in words
                      if w in self.data.word2id
                      and np.random.rand()
                      < self.data.discards[self.data.word2id[w]]
                  ]
  
                  pair_catch = []
                  for i, u in enumerate(word_ids):
                      for j, v in enumerate(
                          word_ids[
                              max(i - self.window_size, 0) : i
                              + self.window_size
                          ]
                      ):
                          assert u < self.data.word_count
                          assert v < self.data.word_count
                          if i == j:
                              continue
                          pair_catch.append(
                              (u, v, self.data.getNegatives(v, 5))
                          )
                  return pair_catch
  
file_path: dgl/examples/pytorch/metapath2vec/reading_data.py
imports: import numpy
  import torch
  from download import AminerDataset
  from torch.utils.data import Dataset
label_desc: Use image node_id 3 for calling the Metapath2vecDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: pair_catch