code: def test_metric_collection_multitask():
      """Check that wrapping some MetricCollections in a MultitaskWrapper is the same as computing them individually."""
      classification_metric = MetricCollection(
          [BinaryAccuracy(), BinaryF1Score()]
      )
      regression_metric = MetricCollection(
          [MeanSquaredError(), MeanAbsoluteError()]
      )
      multitask_metrics = MultitaskWrapper(
          {
              "Classification": MetricCollection(
                  [BinaryAccuracy(), BinaryF1Score()]
              ),
              "Regression": MetricCollection(
                  [MeanSquaredError(), MeanAbsoluteError()]
              ),
          }
      )
  
      assert _multitask_same_as_individual_tasks(
          classification_metric, regression_metric, multitask_metrics
      )
  
file_path: torchmetrics/tests/unittests/wrappers/test_multitask.py
imports: import re
  import pytest
  import torch
  from torchmetrics import MetricCollection
  from torchmetrics.classification import BinaryAccuracy, BinaryF1Score
  from torchmetrics.regression import MeanAbsoluteError, MeanSquaredError
  from torchmetrics.wrappers import MultitaskWrapper
  from unittests import BATCH_SIZE, NUM_BATCHES
  from unittests.helpers import seed_all
label_desc: Use image node_id 6 for calling a global function with example usage: test_metric_collection_multitask() without return types