code: def test_fit_y_index_DatetimeIndex():
      """
      Test index_freq is set correctly when y index is a DatetimeIndex.
      """
      forecaster = ForecasterEquivalentDate(
          offset=5, n_offsets=2, agg_func=np.mean, forecaster_id=None
      )
      y = pd.Series(
          np.random.rand(10),
          index=pd.date_range(start="1/1/2021", periods=10),
      )
      forecaster.fit(y)
  
      assert forecaster.index_freq == y.index.freqstr
  
file_path: skforecast/skforecast/ForecasterBaseline/tests/test_fit.py
imports: import re
  import pytest
  import numpy
  import pandas
  from pandas.tseries.offsets import DateOffset
  from skforecast.ForecasterBaseline import ForecasterEquivalentDate
label_desc: Use image node_id 4 for calling a global function with example usage: test_fit_y_index_DatetimeIndex() without return types