code: def test_set_out_sample_residuals_NotFittedError_when_forecaster_not_fitted():
      """
      Test NotFittedError is raised when forecaster is not fitted.
      """
      forecaster = ForecasterAutoregMultiSeries(
          LinearRegression(), lags=3
      )
      residuals = {
          "l1": np.array([1, 2, 3, 4, 5]),
          "l2": np.array([1, 2, 3, 4, 5]),
      }
  
      err_msg = re.escape(
          (
              "This forecaster is not fitted yet. Call `fit` with appropriate "
              "arguments before using `set_out_sample_residuals()`."
          )
      )
      with pytest.raises(NotFittedError, match=err_msg):
          forecaster.set_out_sample_residuals(residuals=residuals)
  
file_path: skforecast/skforecast/ForecasterAutoregMultiSeries/tests/test_set_out_sample_residuals.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregMultiSeries import ForecasterAutoregMultiSeries
  from sklearn.linear_model import LinearRegression
  from sklearn.exceptions import NotFittedError
  from sklearn.preprocessing import StandardScaler
label_desc: Use image node_id 2 for calling a global function with example usage: test_set_out_sample_residuals_NotFittedError_when_forecaster_not_fitted() without return types