class_docstr: One layer of CARE-GNN.
class_docstr_tok: ["One","layer","of","CARE-GNN","."]
code: def _top_p_sampling(self, g, p):
      # this implementation is low efficient
      # optimization requires dgl.sampling.select_top_p requested in issue #3100
      dist = g.edata["d"]
      neigh_list = []
      for node in g.nodes():
          edges = g.in_edges(node, form="eid")
          num_neigh = th.ceil(g.in_degrees(node) * p).int().item()
          neigh_dist = dist[edges]
          if neigh_dist.shape[0] > num_neigh:
              neigh_index = np.argpartition(
                  neigh_dist.cpu().detach(), num_neigh
              )[:num_neigh]
          else:
              neigh_index = np.arange(num_neigh)
          neigh_list.append(edges[neigh_index])
      return th.cat(neigh_list)
  
file_path: dgl/examples/pytorch/caregnn/model.py
imports: import dgl.function
  import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 3 for calling the CAREConv obj's underlying member method code with example usage: obj._top_p_sampling(g, p) and returns: th