code: def test_set_out_sample_residuals_warning_when_forecaster_has_transformer_and_transform_True():
      """
      Test Warning is raised when forcaster has a transformer_y and transform=True.
      """
      forecaster = ForecasterAutoregMultiSeries(
          LinearRegression(),
          lags=3,
          transformer_series=StandardScaler(),
      )
      forecaster.fit(series=series)
      residuals = {"l1": np.array([1, 2, 3]), "l2": np.array([1, 2, 3])}
      level = "l1"
  
      err_msg = re.escape(
          (
              "Residuals will be transformed using the same transformer used "
              f"when training the forecaster for level {level} : "
              f"({forecaster.transformer_series_[level]}). Ensure that the new "
              "residuals are on the same scale as the original time series."
          )
      )
      with pytest.warns(UserWarning, match=err_msg):
          forecaster.set_out_sample_residuals(
              residuals=residuals, transform=True
          )
  
file_path: skforecast/skforecast/ForecasterAutoregMultiSeries/tests/test_set_out_sample_residuals.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregMultiSeries import ForecasterAutoregMultiSeries
  from sklearn.linear_model import LinearRegression
  from sklearn.exceptions import NotFittedError
  from sklearn.preprocessing import StandardScaler
label_desc: Use image node_id 5 for calling a global function with example usage: test_set_out_sample_residuals_warning_when_forecaster_has_transformer_and_transform_True() without return types