code: def get_dist_max(anchor_set_id, dist):
      # N x K, N is number of nodes, K is the number of anchor sets
      dist_max = torch.zeros((dist.shape[0], len(anchor_set_id)))
      dist_argmax = torch.zeros(
          (dist.shape[0], len(anchor_set_id))
      ).long()
      for i in range(len(anchor_set_id)):
          temp_id = torch.as_tensor(anchor_set_id[i], dtype=torch.long)
          # Get reciprocal of shortest distance to each node in the i-th anchor set
          dist_temp = torch.index_select(dist, 1, temp_id)
          # For each node in the graph, find its closest anchor node in the set
          # and the reciprocal of shortest distance
          dist_max_temp, dist_argmax_temp = torch.max(dist_temp, dim=-1)
          dist_max[:, i] = dist_max_temp
          dist_argmax[:, i] = torch.index_select(
              temp_id, 0, dist_argmax_temp
          )
      return dist_max, dist_argmax
  
imports: import multiprocessing
  import random
  from multiprocessing import get_context
  import networkx
  import numpy
  import torch
  from tqdm.auto import tqdm
label_desc: Use image node_id 13 for calling a global function with example usage: get_dist_max(anchor_set_id, dist) and returns: dist_max,  dist_argmax