code: def test_copy_dim(name):
      forecast = MULTIVARIATE_FORECASTS[name]
      for dim in range(forecast.dim()):
          univariate_forecast = forecast.copy_dim(dim)
  
          assert univariate_forecast.dim() == 1
          assert univariate_forecast.start_date == forecast.start_date
          assert univariate_forecast.item_id == forecast.item_id
          assert univariate_forecast.info == forecast.info
  
          if name == "SampleForecast":
              assert np.array_equal(
                  univariate_forecast.samples,
                  MULTIVARIATE_FORECASTS[name].samples[:, :, dim],
              )
          else:
              assert np.array_equal(
                  univariate_forecast.forecast_array,
                  MULTIVARIATE_FORECASTS[name].forecast_array[
                      :, :, dim
                  ],
              )
  
file_path: gluonts/test/model/test_forecast.py
imports: import numpy
  import pandas
  import pytest
  from gluonts.model.forecast import QuantileForecast, SampleForecast, _linear_interpolation, ExponentialTailApproximation
label_desc: Use image node_id 4 for calling a global function with example usage: test_copy_dim(name) without return types