code: def test_IgnoredArgumentWarning_initialize_lags_grid_when_forecaster_has_custom_predictors(
      forecaster,
  ):
      """
      Test IgnoredArgumentWarning is raised when forecaster is `ForecasterAutoregCustom`
      or `ForecasterAutoregMultiSeriesCustom`.
      """
      lags_grid = [1, 2, 3]
  
      warn_msg = re.escape(
          (
              f"`lags_grid` ignored if forecaster is an instance of "
              f"`{type(forecaster).__name__}`."
          ),
      )
      with pytest.warns(IgnoredArgumentWarning, match=warn_msg):
          initialize_lags_grid(forecaster, lags_grid)
  
file_path: skforecast/skforecast/utils/tests/test_initialize_lags_grid.py
imports: import re
  import pytest
  import numpy
  import pandas
  from sklearn.linear_model import Ridge
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from skforecast.ForecasterAutoregMultiSeriesCustom import ForecasterAutoregMultiSeriesCustom
  from skforecast.utils import initialize_lags_grid
  from skforecast.exceptions import IgnoredArgumentWarning
label_desc: Use image node_id 3 for calling a global function with example usage: test_IgnoredArgumentWarning_initialize_lags_grid_when_forecaster_has_custom_predictors(forecaster) without return types