code: def test_set_out_sample_residuals_when_residuals_length_is_less_than_1000_and_no_append():
      """
      Test residuals stored when new residuals length is less than 1000 and append is False.
      """
      forecaster = ForecasterAutoregCustom(
          regressor=LinearRegression(),
          fun_predictors=create_predictors,
          window_size=5,
      )
      forecaster.set_out_sample_residuals(residuals=np.arange(20))
      forecaster.set_out_sample_residuals(
          residuals=np.arange(10), append=False
      )
      expected = np.arange(10)
      results = forecaster.out_sample_residuals
  
      assert (results == expected).all()
  
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 7 for calling a global function with example usage: test_set_out_sample_residuals_when_residuals_length_is_less_than_1000_and_no_append() without return types