code: def test_set_out_sample_residuals_TypeError_when_residuals_is_not_numpy_ndarray():
      """
      Test TypeError is raised when residuals argument is not numpy ndarray.
      """
      forecaster = ForecasterAutoregCustom(
          regressor=LinearRegression(),
          fun_predictors=create_predictors,
          window_size=5,
      )
      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/ForecasterAutoregCustom/tests/test_set_out_sample_residuals.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from sklearn.linear_model import LinearRegression
  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_TypeError_when_residuals_is_not_numpy_ndarray() without return types