code: def test_adjusted_mutual_info_score_functional_single_cluster(
      average_method,
  ):
      """Check that for single cluster the metric returns 0."""
      tensor_a = torch.randint(NUM_CLASSES, (BATCH_SIZE,))
      tensor_b = torch.zeros((BATCH_SIZE,), dtype=torch.int)
      assert torch.allclose(
          adjusted_mutual_info_score(
              tensor_a, tensor_b, average_method
          ),
          torch.tensor(0.0),
          atol=ATOL,
      )
      assert torch.allclose(
          adjusted_mutual_info_score(
              tensor_b, tensor_a, average_method
          ),
          torch.tensor(0.0),
          atol=ATOL,
      )
  
file_path: torchmetrics/tests/unittests/clustering/test_adjusted_mutual_info_score.py
imports: from functools import partial
  import pytest
  import torch
  from sklearn.metrics import adjusted_mutual_info_score
  from torchmetrics.clustering.adjusted_mutual_info_score import AdjustedMutualInfoScore
  from torchmetrics.functional.clustering.adjusted_mutual_info_score import adjusted_mutual_info_score
  from unittests import BATCH_SIZE, NUM_CLASSES
  from unittests.clustering.inputs import _float_inputs_extrinsic, _single_target_extrinsic1, _single_target_extrinsic2
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling a global function with example usage: test_adjusted_mutual_info_score_functional_single_cluster(average_method) without return types