code: def test_set_out_sample_residuals_warning_when_forecaster_has_transformer_and_transform_False():
      """
      Test Warning is raised when forcaster has a transformer_series and transform=False.
      """
      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(
          (
              "Argument `transform` is set to `False` but forecaster was "
              f"trained using a transformer {forecaster.transformer_series_[level]} "
              f"for level {level}. Ensure that the new residuals are "
              "already transformed or set `transform=True`."
          )
      )
      with pytest.warns(UserWarning, match=err_msg):
          forecaster.set_out_sample_residuals(
              residuals=residuals, transform=False
          )
  
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 4 for calling a global function with example usage: test_set_out_sample_residuals_warning_when_forecaster_has_transformer_and_transform_False() without return types