code: def test_when_point_forecast_metric_is_used_then_per_item_residuals_are_used_for_prediction(
      temp_model_path, model_type
  ):
      data = DUMMY_VARIABLE_LENGTH_TS_DATAFRAME.sort_index()
      prediction_length = 5
      model = model_type(
          path=temp_model_path,
          freq=data.freq,
          prediction_length=prediction_length,
          eval_metric="MASE",
      )
      model.fit(train_data=data, time_limit=15)
      assert (
          model._residuals_std_per_item.index == sorted(data.item_ids)
      ).all()
  
      # Remove _avg_residuals_std to ensure that it's not used to impute missing values
      model._avg_residuals_std = None
  
      predictions = model.predict(data)
      expected_forecast_index = get_forecast_horizon_index_ts_dataframe(
          data, prediction_length
      )
      assert not predictions.isna().values.any()
      assert (predictions.index == expected_forecast_index).all()
  
file_path: autogluon/timeseries/tests/unittests/models/test_mlforecast.py
imports: from unittest import mock
  import numpy
  import pandas
  import pytest
  from autogluon.timeseries import TimeSeriesDataFrame
  from autogluon.timeseries.models.autogluon_tabular.mlforecast import DirectTabularModel, RecursiveTabularModel
  from autogluon.timeseries.utils.features import TimeSeriesFeatureGenerator
  from autogluon.timeseries.utils.forecast import get_forecast_horizon_index_ts_dataframe
  from ..common import DATAFRAME_WITH_COVARIATES, DATAFRAME_WITH_STATIC, DUMMY_VARIABLE_LENGTH_TS_DATAFRAME, get_data_frame_with_variable_lengths
label_desc: Use image node_id 8 for calling a global function with example usage: test_when_point_forecast_metric_is_used_then_per_item_residuals_are_used_for_prediction(temp_model_path, model_type) without return types