code: def test_with_custom_prefix_postfix():
      """Test that metric collection does not clash with custom prefix and postfix in users metrics.
  
      See issue: https://github.com/Lightning-AI/torchmetrics/issues/2065
  
      """
  
      class CustomAccuracy(MulticlassAccuracy):
          prefix = "my_prefix"
          postfix = "my_postfix"
  
          def compute(self):
              value = super().compute()
              return {f"{self.prefix}/accuracy/{self.postfix}": value}
  
      class CustomPrecision(MulticlassAccuracy):
          prefix = "my_prefix"
          postfix = "my_postfix"
  
          def compute(self):
              value = super().compute()
              return {f"{self.prefix}/precision/{self.postfix}": value}
  
      metrics = MetricCollection(
          [
              CustomAccuracy(num_classes=2),
              CustomPrecision(num_classes=2),
          ]
      )
  
      # Update metrics with current batch
      res = metrics(
          torch.tensor([1, 0, 0, 1]), torch.tensor([1, 0, 0, 0])
      )
  
      # Print the calculated metrics
      assert "my_prefix/accuracy/my_postfix" in res
      assert "my_prefix/precision/my_postfix" in res
  
imports: import pickle
  from copy import deepcopy
  from typing import Any
  import pytest
  import torch
  from torchmetrics import Metric, MetricCollection
  from torchmetrics.classification import BinaryAccuracy, MulticlassAccuracy, MulticlassAUROC, MulticlassAveragePrecision, MulticlassCohenKappa, MulticlassConfusionMatrix, MulticlassF1Score, MulticlassMatthewsCorrCoef, MulticlassPrecision, MulticlassRecall, MultilabelAUROC, MultilabelAveragePrecision
  from torchmetrics.utilities.checks import _allclose_recursive
  from unittests.helpers import seed_all
  from unittests.helpers.testers import DummyMetricDiff, DummyMetricMultiOutputDict, DummyMetricSum
label_desc: Use image node_id 16 for calling a global function with example usage: test_with_custom_prefix_postfix() and returns: dict, dict