code: def batch_v(feat, R, all_num):
      V = np.zeros((all_num, all_num), dtype=np.float32)
      m = feat.shape[0]
      for i in tqdm(range(m)):
          temp_gf = feat[i].reshape(1, -1)
          temp_qd = euclidean_distance(temp_gf, feat)
          temp_qd = temp_qd / (np.max(temp_qd))
          temp_qd = temp_qd.reshape(-1)
          temp_qd = temp_qd[R[i].tolist()]
          weight = np.exp(-temp_qd)
          weight = weight / np.sum(weight)
          V[i, R[i]] = weight.astype(np.float32)
      return V
  
imports: import os
  import re
  import cv2
  import gc
  import numpy
  import pandas
  from tqdm import tqdm
  import warnings
label_desc: Use image node_id 16 for calling a global function with example usage: batch_v(feat, R, all_num) and returns: V