code: def test_fit_in_sample_residuals_stored(n_jobs):
      """
      Test that values of in_sample_residuals are stored after fitting.
      """
      forecaster = ForecasterAutoregDirect(
          LinearRegression(), lags=3, steps=2, n_jobs=n_jobs
      )
      forecaster.fit(y=pd.Series(np.arange(5)))
      expected = {1: np.array([0.0]), 2: np.array([0.0])}
      results = forecaster.in_sample_residuals
  
      assert isinstance(results, dict)
      assert all(isinstance(x, np.ndarray) for x in results.values())
      assert results.keys() == expected.keys()
      assert all(
          all(np.isclose(results[k], expected[k]))
          for k in expected.keys()
      )
  
file_path: skforecast/skforecast/ForecasterAutoregDirect/tests/test_fit.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregDirect import ForecasterAutoregDirect
  from sklearn.linear_model import LinearRegression
label_desc: Use image node_id 3 for calling a global function with example usage: test_fit_in_sample_residuals_stored(n_jobs) without return types