code: def __call__(self):
      np.random.seed(os.getpid())
      if self.neg_sample_type == "outdegree":
          outdegree = self.graph.outdegree()
          distribution = 1.0 * outdegree / outdegree.sum()
          alias, events = alias_sample_build_table(distribution)
      max_len = int(
          self.batch_size * self.walk_len * ((1 + self.win_size) - 0.3)
      )
      for walks in self.walk_generator():
          try:
              src_list, pos_list = [], []
              for walk in walks:
                  s, p = skip_gram_gen_pair(walk, self.win_size)
                  src_list.append(s[:max_len]), pos_list.append(
                      p[:max_len]
                  )
              src = [s for x in src_list for s in x]
              pos = [s for x in pos_list for s in x]
              src = (np.array(src, dtype=np.int64),)
              pos = np.array(pos, dtype=np.int64)
              src, pos = np.reshape(src, [-1, 1, 1]), np.reshape(
                  pos, [-1, 1, 1]
              )
  
              neg_sample_size = [len(pos), self.neg_num, 1]
              if src.shape[0] == 0:
                  continue
              if self.neg_sample_type == "average":
                  negs = np.random.randint(
                      low=0,
                      high=self.graph.num_nodes,
                      size=neg_sample_size,
                  )
              elif self.neg_sample_type == "outdegree":
                  negs = alias_sample(neg_sample_size, alias, events)
              elif self.neg_sample_type == "inbatch":
                  pass
              dst = np.concatenate([pos, negs], 1)
              # [batch_size, 1, 1] [batch_size, neg_num+1, 1]
              yield src[:max_len], dst[:max_len]
          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 paddle
  from pgl.utils.logger import log
  from pgl.sample import node2vec_sample
  from pgl.sample import deepwalk_sample
  from pgl.sample import alias_sample
  from pgl.graph_kernel import skip_gram_gen_pair
  from pgl.graph_kernel import alias_sample_build_table
  from pgl.utils import mp_reader
label_desc: Use image node_id 5 for calling the DeepwalkReader obj's underlying member method code with example usage: obj.__call__() without return types