code: def test_f1_measure_catches_exceptions(self):
      f1_measure = F1Measure(0)
      predictions = torch.rand([5, 7])
      out_of_range_labels = torch.Tensor([10, 3, 4, 0, 1])
      with pytest.raises(ConfigurationError):
          f1_measure(predictions, out_of_range_labels)
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/training/metrics/f1_measure_test.py
imports: from __future__ import with_statement
  from __future__ import absolute_import
  import torch
  import pytest
  import numpy
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.common.checks import ConfigurationError
  from allennlp.training.metrics import F1Measure
label_desc: Use image node_id 1 for calling the F1MeasureTest obj's underlying member method code with example usage: obj.test_f1_measure_catches_exceptions() without return types