code: def sample_blocks(self, seeds):
      import torch as th
  
      seeds = th.LongTensor(np.asarray(seeds))
      blocks = []
      for fanout in self.fanouts:
          # For each seed node, sample ``fanout`` neighbors.
          frontier = self.sample_neighbors(
              self.g, seeds, fanout, replace=True
          )
          # Then we compact the frontier into a bipartite graph for
          # message passing.
          block = dgl.to_block(frontier, seeds)
          # Obtain the seed nodes for next layer.
          seeds = block.srcdata[dgl.NID]
          block.edata["original_eids"] = frontier.edata[dgl.EID]
  
          blocks.insert(0, block)
      return blocks
  
imports: import json
  import os
  from itertools import product
  import dgl
  import dgl.backend
  import numpy
  from dgl.distributed import edge_split, load_partition_book, node_split
label_desc: Use image node_id 2 for calling the NeighborSampler obj's underlying member method code with example usage: obj.sample_blocks(seeds) and returns: blocks