code: def __init__(
      self,
      include=(),
      exclude=(),
      avg_of_avgs=False,
      return_per_class=False,
      k=None,
      label_comparison_fn=None,
      device=None,
      knn_func=None,
      kmeans_func=None,
  ):
      self.function_keyword = "calculate_"
      function_names = [
          x for x in dir(self) if x.startswith(self.function_keyword)
      ]
      metrics = [
          x.replace(self.function_keyword, "", 1)
          for x in function_names
      ]
      self.original_function_dict = {
          x: getattr(self, y) for x, y in zip(metrics, function_names)
      }
      self.check_primary_metrics(include, exclude)
      self.original_function_dict = self.get_function_dict(
          include, exclude
      )
      self.curr_function_dict = self.get_function_dict()
  
      if avg_of_avgs and return_per_class:
          raise ValueError(
              "avg_of_avgs and return_per_class are mutually exclusive"
          )
      self.avg_of_avgs = avg_of_avgs
      self.return_per_class = return_per_class
  
      self.device = (
          c_f.use_cuda_if_available() if device is None else device
      )
      self.knn_func = FaissKNN() if knn_func is None else knn_func
      self.kmeans_func = (
          FaissKMeans(niter=20, gpu=self.device.type == "cuda")
          if kmeans_func is None
          else kmeans_func
      )
  
      if (not (isinstance(k, int) and k > 0)) and (
          k not in [None, "max_bin_count"]
      ):
          raise ValueError(
              "k must be an integer greater than 0, or None, or 'max_bin_count'"
          )
      self.k = k
  
      if label_comparison_fn:
          self.label_comparison_fn = label_comparison_fn
          if any(
              x in self.requires_clustering()
              for x in self.get_curr_metrics()
          ):
              raise NotImplementedError(
                  "Unsupported: clustering + custom label comparison"
              )
      else:
          self.label_comparison_fn = EQUALITY
  
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 1 to create a new AccuracyCalculator object  with example: obj = AccuracyCalculator(include, exclude, avg_of_avgs, return_per_class, k, label_comparison_fn, device, knn_func, kmeans_func)