docstr: Given a batch of target nodes, sample postive
  pairs and negative pairs from the graph
docstr_tok: ["Given","a","batch","of","target","nodes",",","sample","postive","pairs","and","negative","pairs","from","the","graph"]
code: def sample(self, batch, sku_info):
      """
      Given a batch of target nodes, sample postive
      pairs and negative pairs from the graph
      """
      batch = np.repeat(batch, self.num_walks)
  
      pos_pairs = self.generate_pos_pairs(batch)
      neg_pairs = self.generate_neg_pairs(pos_pairs)
  
      # get sku info with id
      srcs, dsts, labels = [], [], []
      for pair in pos_pairs + neg_pairs:
          src, dst, label = pair
          src_info = sku_info[src]
          dst_info = sku_info[dst]
  
          srcs.append(src_info)
          dsts.append(dst_info)
          labels.append(label)
  
      return th.tensor(srcs), th.tensor(dsts), th.tensor(labels)
  
file_path: dgl/examples/pytorch/eges/sampler.py
imports: import dgl
  import numpy
  import torch
label_desc: Use image node_id 2 for calling the Sampler obj's underlying member method code with example usage: obj.sample(batch, sku_info) and returns: th,  th,  th