code: def pr_drop_weights(edge_index, aggr: str = "sink", k: int = 10):
      """Returns the dropping weight of each edge depending on the PageRank centrality
      Args:
          edge_index (torch.Tensor): A tensor of shape [2, n_edges]
      :rtype: :class:`Tensor`
      """
      pv = compute_pr(edge_index, k=k)
      pv_row = pv[edge_index[0]].to(torch.float32)
      pv_col = pv[edge_index[1]].to(torch.float32)
      s_row = torch.log(pv_row)
      s_col = torch.log(pv_col)
      if aggr == "sink":
          s = s_col
      elif aggr == "source":
          s = s_row
      elif aggr == "mean":
          s = (s_col + s_row) * 0.5
      else:
          s = s_col
      weights = (s.max() - s) / (s.max() - s.mean())
  
      return weights
  
file_path: DIG/dig/sslgraph/utils/adaptive.py
imports: import torch
  from torch.utils.data import random_split
  from torch_geometric.utils import degree, remove_self_loops, get_laplacian, to_undirected, to_dense_adj, to_networkx, degree, to_undirected
  from torch_scatter import scatter
  import networkx
label_desc: Use image node_id 8 for calling a global function with example usage: pr_drop_weights(edge_index, aggr, k) and returns: weights