code: def MRRatK_r(r, k):
      """
      Mean Reciprocal Rank
      """
      pred_data = r[:, :k]
      scores = np.log2(1.0 / np.arange(1, k + 1))
      pred_data = pred_data / scores
      pred_data = pred_data.sum(1)
      return np.sum(pred_data)
  
imports: import paddle
  from paddle import nn, optimizer
  import numpy
  from paddle import log
  from dataloader import BasicDataset
  from paddle.io import Dataset
  from time import time
  from sklearn.metrics import roc_auc_score
  import random
  import os
  from tqdm import tqdm
label_desc: Use image node_id 5 for calling a global function with example usage: MRRatK_r(r, k) and returns: np