code: def test_set_out_sample_residuals_UserWarning_when_residuals_not_for_all_steps():
      """
      Test UserWarning is raised when residuals does not contain a residue for all steps.
      """
      forecaster = ForecasterAutoregDirect(
          LinearRegression(fit_intercept=True), lags=3, steps=2
      )
      forecaster.fit(y=y)
      residuals = {1: np.array([1, 2, 3])}
  
      err_msg = re.escape(
          f"""
                  Only residuals of models (steps) 
                  {set({1: None, 2: None}.keys()).intersection(set(residuals.keys()))} 
                  are updated.
                  """
      )
      with pytest.warns(UserWarning, match=err_msg):
          forecaster.set_out_sample_residuals(residuals=residuals)
  
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 3 for calling a global function with example usage: test_set_out_sample_residuals_UserWarning_when_residuals_not_for_all_steps() without return types