code: def _compare_func(preds, target, mode):
      if mode == "probs":
          counts = np.zeros((preds.shape[0], preds.shape[1]))
          preds = preds.argmax(dim=1)
          for participant in range(preds.shape[0]):
              for rater in range(preds.shape[1]):
                  counts[participant, preds[participant, rater]] += 1
          return sk_fleiss_kappa(counts)
      return sk_fleiss_kappa(preds)
  
file_path: torchmetrics/tests/unittests/nominal/test_fleiss_kappa.py
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from statsmodels.stats.inter_rater import fleiss_kappa
  from torchmetrics.functional.nominal.fleiss_kappa import fleiss_kappa
  from torchmetrics.nominal.fleiss_kappa import FleissKappa
  from unittests import BATCH_SIZE, NUM_BATCHES, NUM_CLASSES
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling a global function with example usage: _compare_func(preds, target, mode) and returns: sk_fleiss_kappa, sk_fleiss_kappa