code: def _random_counts(high, size):
      """Generate random counts matrix that is fully ranked.
  
      Interface is similar to torch.randint.
  
      """
      x = torch.randint(high=high, size=size)
      x_sum = x.sum(-1)
      x_total = x_sum.max()
      x[:, :, -1] = x_total - (x_sum - x[:, :, -1])
      return x
  
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 3 for calling a global function with example usage: _random_counts(high, size) and returns: x