code: def test_set_out_sample_residuals_when_residuals_length_is_greater_than_1000():
      """
      Test len residuals stored when its length is greater than 1000.
      """
      forecaster = ForecasterAutoregDirect(
          LinearRegression(fit_intercept=True), lags=3, steps=2
      )
      forecaster.fit(y=y)
      residuals = {1: np.arange(2000), 2: np.arange(2000)}
  
      forecaster.set_out_sample_residuals(residuals=residuals)
      results = forecaster.out_sample_residuals
  
      assert list(results.keys()) == [1, 2]
      assert all(len(value) == 1000 for value in results.values())
  
file_path: skforecast/skforecast/ForecasterAutoregDirect/tests/test_set_out_sample_residuals.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregDirect import ForecasterAutoregDirect
  from sklearn.linear_model import LinearRegression
  from sklearn.exceptions import NotFittedError
  from sklearn.preprocessing import StandardScaler
label_desc: Use image node_id 8 for calling a global function with example usage: test_set_out_sample_residuals_when_residuals_length_is_greater_than_1000() without return types