code: def calculate_mean_reciprocal_rank(
      self,
      knn_labels,
      query_labels,
      not_lone_query_mask,
      label_counts,
      **kwargs,
  ):
      knn_labels, query_labels = try_getting_not_lone_labels(
          knn_labels, query_labels, not_lone_query_mask
      )
      if knn_labels is None:
          return nan_accuracy(label_counts[0], self.return_per_class)
  
      return mean_reciprocal_rank(
          knn_labels,
          query_labels[:, None],
          self.avg_of_avgs,
          self.return_per_class,
          self.label_comparison_fn,
      )
  
imports: import torch
  from sklearn.metrics import adjusted_mutual_info_score, normalized_mutual_info_score
  from .None import common_functions
  from .inference import FaissKMeans, FaissKNN
label_desc: Use image node_id 12 for calling the AccuracyCalculator obj's underlying member method code with example usage: obj.calculate_mean_reciprocal_rank(knn_labels, query_labels, not_lone_query_mask, label_counts) and returns: mean_reciprocal_rank, nan_accuracy