code: def test_set_out_sample_residuals_when_residuals_keys_partially_match():
      """
      Test residuals are stored only for matching keys.
      """
      forecaster = ForecasterAutoregMultiVariate(
          LinearRegression(fit_intercept=True),
          level="l1",
          lags=3,
          steps=2,
          transformer_series=None,
      )
      forecaster.fit(series=series)
      residuals = {1: np.arange(10), 4: np.arange(10)}
  
      forecaster.set_out_sample_residuals(residuals=residuals)
      results = forecaster.out_sample_residuals
  
      assert list(results.keys()) == [1, 2]
      assert all(results[1] == np.arange(10))
      assert results[2] is None
  
file_path: skforecast/skforecast/ForecasterAutoregMultiVariate/tests/test_set_out_sample_residuals.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregMultiVariate import ForecasterAutoregMultiVariate
  from sklearn.linear_model import LinearRegression
  from sklearn.exceptions import NotFittedError
  from sklearn.preprocessing import StandardScaler
label_desc: Use image node_id 11 for calling a global function with example usage: test_set_out_sample_residuals_when_residuals_keys_partially_match() without return types