code: def pair_generate(self):
      for walks in self.walk_generator():
          try:
              src_list, pos_list = [], []
              for walk in walks:
                  s, p = skip_gram_gen_pair(walk, self.config.win_size)
                  src_list.append(s), pos_list.append(p)
              src = [s for x in src_list for s in x]
              pos = [s for x in pos_list for s in x]
  
              if len(src) == 0:
                  continue
  
              negs = self.negative_sample(
                  src,
                  pos,
                  neg_num=self.config.neg_num,
                  neg_sample_type=self.config.neg_sample_type,
              )
  
              src = np.array(src, dtype=np.int64).reshape(-1, 1, 1)
              pos = np.array(pos, dtype=np.int64).reshape(-1, 1, 1)
  
              yield src, pos, negs
  
          except Exception as e:
              log.exception(e)
  
imports: from __future__ import division
  from __future__ import absolute_import
  from __future__ import print_function
  import time
  import io
  import os
  import numpy
  import random
  from pgl.utils.logger import log
  from pgl.sample import metapath_randomwalk
  from pgl.graph_kernel import skip_gram_gen_pair
  from pgl.graph_kernel import alias_sample_build_table
  from utils import load_config
  from graph import m2vGraph
  import mp_reader
label_desc: Use image node_id 3 for calling the DataGenerator obj's underlying member method code with example usage: obj.pair_generate() without return types