code: def test_initialize_lags_grid_when_lags_grid_is_a_list():
      """
      Test initialize_lags_grid when lags_grid is a list.
      """
      forecaster = ForecasterAutoreg(
          regressor=Ridge(random_state=123), lags=2
      )
      lags_grid = [1, [2, 4], range(3, 5), np.array([3, 7])]
      lags_grid, lags_label = initialize_lags_grid(
          forecaster, lags_grid
      )
  
      lags_grid_expected = {
          "1": 1,
          "[2, 4]": [2, 4],
          "range(3, 5)": range(3, 5),
          "[3 7]": np.array([3, 7]),
      }
  
      assert lags_label == "values"
      assert lags_grid.keys() == lags_grid_expected.keys()
      for v, v_expected in zip(
          lags_grid.values(), lags_grid_expected.values()
      ):
          if isinstance(v, np.ndarray):
              assert np.array_equal(v, v_expected)
          elif isinstance(v, range):
              assert list(v) == list(v_expected)
          else:
              assert v == v_expected
  
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 4 for calling a global function with example usage: test_initialize_lags_grid_when_lags_grid_is_a_list() without return types