code: def test_get_cutoff_inferred_freq():
      """Tests that get_cutoff infers the freq in a case where it is not directly set.
  
      Ensures that the bug in #4405 does not occur, combined with the forecaster contract.
      """
      np.random.seed(seed=0)
  
      past_data = pd.DataFrame(
          {
              "time_identifier": pd.to_datetime(
                  [
                      "2024-01-01",
                      "2024-01-02",
                      "2024-01-03",
                      "2024-01-04",
                      "2024-01-05",
                      "2024-01-06",
                      "2024-01-07",
                      "2024-01-08",
                  ],
                  format="%Y-%m-%d",
              ),
              "series_data": np.random.random(size=8),
          }
      )
      past_data = past_data.set_index(["time_identifier"])
      cutoff = get_cutoff(past_data, return_index=True)
      assert cutoff.freq == "D"
  
file_path: sktime/sktime/datatypes/tests/test_utils.py
imports: import numpy
  import pandas
  import pytest
  from sktime.datatypes._check import check_is_mtype
  from sktime.datatypes._examples import get_examples
  from sktime.datatypes._utilities import _get_cutoff_from_index, get_cutoff, get_slice, get_time_index, get_window
  from sktime.utils._testing.hierarchical import _make_hierarchical
label_desc: Use image node_id 5 for calling a global function with example usage: test_get_cutoff_inferred_freq() without return types