code: def sample_frontier(self, block_id, g, seed_nodes, *args, **kwargs):
      with g.local_scope():
          new_edges_masks = {}
          for etype in g.canonical_etypes:
              edge_mask = th.zeros(g.num_edges(etype))
              # extract each node from dict because of single node type
              for node in seed_nodes:
                  edges = g.in_edges(node, form="eid", etype=etype)
                  num_neigh = (
                      th.ceil(
                          g.in_degrees(node, etype=etype)
                          * self.p[block_id][etype]
                      )
                      .int()
                      .item()
                  )
                  neigh_dist = self.dists[block_id][etype][edges]
                  if neigh_dist.shape[0] > num_neigh:
                      neigh_index = np.argpartition(
                          neigh_dist, num_neigh
                      )[:num_neigh]
                  else:
                      neigh_index = np.arange(num_neigh)
                  edge_mask[edges[neigh_index]] = 1
              new_edges_masks[etype] = edge_mask.bool()
  
          return dgl.edge_subgraph(
              g, new_edges_masks, relabel_nodes=False
          )
  
imports: import dgl
  import dgl.function
  import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the CARESampler obj's underlying member method code with example usage: obj.sample_frontier(block_id, g, seed_nodes) and returns: dgl