code: def compute_pr(edge_index, damp: float = 0.85, k: int = 10):
      """Returns the PageRank centrality given the edge_index
      Args:
          edge_index (torch.Tensor): Tensor of shape [2, n_edges]
          damp (float, optional): Damping factor
          k (int, optional): Number of iterations
      """
      num_nodes = edge_index.max().item() + 1
      deg_out = degree(edge_index[0])
      x = (
          torch.ones((num_nodes,))
          .to(edge_index.device)
          .to(torch.float32)
      )
  
      for i in range(k):
          edge_msg = x[edge_index[0]] / deg_out[edge_index[0]]
          agg_msg = scatter(edge_msg, edge_index[1], reduce="sum")
  
          x = (1 - damp) * x + damp * agg_msg
  
      return x
  
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 1 for calling a global function with example usage: compute_pr(edge_index, damp, k) and returns: x