code: def test_classification_single_label(dummy_class_map, label_ids):
      rec = BaseRecord(
          [ClassificationLabelsRecordComponent(is_multilabel=False)]
      )
      rec.classification.set_class_map(dummy_class_map)
      rec.classification.set_labels_by_id(label_ids)
  
      if len(label_ids) > 1:
          # label_ids == [0, 1]
          # Setting two labels when `is_multilabel=False` raises an error
          with pytest.raises(AutofixAbort):
              rec.classification._autofix()
      else:
          # label_ids == [0]
          # Only one label must be assigned
          assert all(rec.classification._autofix().values())
          assert rec.classification.one_hot_encoded().sum() == 1
  
imports: import pytest
  from icevision.all import *
label_desc: Use image node_id 4 for calling a global function with example usage: test_classification_single_label(dummy_class_map, label_ids) without return types