code: def test_set_out_sample_residuals_TypeError_when_residuals_is_not_numpy_array():
      """
      Test TypeError is raised when residuals argument is not numpy ndarray.
      """
      forecaster = ForecasterAutoreg(LinearRegression(), lags=3)
      residuals = pd.Series([1, 2, 3])
  
      err_msg = re.escape(
          f"`residuals` argument must be `numpy ndarray`. Got {type(residuals)}."
      )
      with pytest.raises(TypeError, match=err_msg):
          forecaster.set_out_sample_residuals(residuals=residuals)
  
file_path: skforecast/skforecast/ForecasterAutoreg/tests/test_set_out_sample_residuals.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  from sklearn.linear_model import LinearRegression
  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_numpy_array() without return types