code: def test_raises_error_if_increment_not_called(method, method_input):
      """Test that error is raised if another method is called before increment."""
      tracker = MetricTracker(MulticlassAccuracy(num_classes=10))
      with pytest.raises(
          ValueError, match=f"`{method}` cannot be called before .*"
      ):  # noqa: PT012
          if method_input is not None:
              getattr(tracker, method)(*method_input)
          else:
              getattr(tracker, method)()
  
file_path: torchmetrics/tests/unittests/wrappers/test_tracker.py
imports: import pytest
  import torch
  from torchmetrics import MetricCollection
  from torchmetrics.classification import MulticlassAccuracy, MulticlassConfusionMatrix, MulticlassPrecision, MulticlassRecall
  from torchmetrics.regression import MeanAbsoluteError, MeanSquaredError
  from torchmetrics.wrappers import MetricTracker, MultioutputWrapper
  from unittests.helpers import seed_all
label_desc: Use image node_id 2 for calling a global function with example usage: test_raises_error_if_increment_not_called(method, method_input) without return types