code: def test_composite_metric():
      metric1 = SMAPE()
      metric2 = MAE()
      combined_metric = 1.0 * (0.3 * metric1 + 2.0 * metric2 + metric1)
      assert isinstance(
          combined_metric, CompositeMetric
      ), "combined metric should be composite metric"
  
      # test repr()
      repr(combined_metric)
  
      # test results
      y = torch.normal(0, 1, (10, 20)).abs()
      y_pred = torch.normal(0, 1, (10, 20)).abs()
  
      res1 = metric1(y_pred, y)
      res2 = metric2(y_pred, y)
      combined_res = combined_metric(y_pred, y)
  
      assert torch.isclose(combined_res, res1 * 0.3 + res2 * 2.0 + res1)
  
      # test quantiles and prediction
      combined_metric.to_prediction(y_pred)
      combined_metric.to_quantiles(y_pred)
  
file_path: pytorch-forecasting/tests/test_metrics.py
imports: import itertools
  import numpy
  import pytest
  import torch
  from torch.nn.utils import rnn
  from pytorch_forecasting.data.encoders import TorchNormalizer
  from pytorch_forecasting.metrics import MAE, SMAPE, BetaDistributionLoss, ImplicitQuantileNetworkDistributionLoss, LogNormalDistributionLoss, MultivariateNormalDistributionLoss, NegativeBinomialDistributionLoss, NormalDistributionLoss
  from pytorch_forecasting.metrics.base_metrics import AggregationMetric, CompositeMetric
label_desc: Use image node_id 1 for calling a global function with example usage: test_composite_metric() without return types