class_docstr: Implementation of Dataset class
  
  This is a simple implementation of loading and processing dataset for GATNE model.
  
  Args:
      config: dict, some configure parameters.
class_docstr_tok: ["Implementation","of","Dataset","class","This","is","a","simple","implementation","of","loading","and","processing","dataset","for","GATNE","model",".","Args",":","config",":","dict",",","some","configure","parameters","."]
docstr: Produce batch pairs data for training.
          
docstr_tok: ["Produce","batch","pairs","data","for","training","."]
code: def fetch_batch(self, pairs, batch_size, for_test=False):
      """Produce batch pairs data for training."""
      np.random.shuffle(pairs)
      n_batches = (len(pairs) + (batch_size - 1)) // batch_size
      neg_num = len(pairs[0]) - 3
  
      result = []
      for i in range(1, n_batches):
          batch_pairs = np.array(
              pairs[batch_size * (i - 1) : batch_size * i],
              dtype=np.int64,
          )
          x = (
              batch_pairs[:, 0]
              .reshape(
                  -1,
              )
              .astype(np.int64)
          )
          y = batch_pairs[:, 1].reshape(-1, 1, 1).astype(np.int64)
          neg = (
              batch_pairs[:, 2 : 2 + neg_num]
              .reshape(-1, neg_num, 1)
              .astype(np.int64)
          )
          t = batch_pairs[:, -1].reshape(-1, 1).astype(np.int64)
          result.append((x, y, neg, t))
      return result
  
file_path: PGL/legacy/examples/GATNE/Dataset.py
imports: import sys
  import os
  import tqdm
  import numpy
  import logging
  import random
  from pgl import heter_graph
  import pickle
label_desc: Use image node_id 9 for calling the Dataset obj's underlying member method code with example usage: obj.fetch_batch(pairs, batch_size, for_test) and returns: result