code: def test_set_out_sample_residuals_TypeError_when_residuals_is_not_a_dict_of_numpy_ndarray(
      residuals,
  ):
      """
      Test TypeError is raised when residuals is not a dict of numpy ndarrays.
      """
      forecaster = ForecasterAutoregMultiSeries(
          LinearRegression(), lags=3
      )
      err_msg = re.escape(
          f"`residuals` argument must be a dict of numpy ndarrays in the form "
          "`{level: residuals}`. "
          f"Got {type(residuals)}."
      )
      with pytest.raises(TypeError, 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 1 for calling a global function with example usage: test_set_out_sample_residuals_TypeError_when_residuals_is_not_a_dict_of_numpy_ndarray(residuals) without return types