code: def test_infer_frequency():
      df = create_mock_df()
      assert infer_frequency(df, "time_col") == "Q-DEC"
  
      df = create_mock_df(freq="M")
      assert infer_frequency(df, "time_col") == "M"
  
      # Should still work if we pass string dates
      df["time_col"] = df["time_col"].astype(str)
      assert infer_frequency(df, "time_col") == "M"
  
      # Should still work if we pass unordered dates
      unordered_df = pd.concat([df.iloc[:3, :], df.iloc[3:, :]])
      assert infer_frequency(unordered_df, "time_col") == "M"
  
file_path: mindsdb/tests/unit/ml_handlers/test_time_series_utils.py
imports: import pandas
  from statsforecast.utils import AirPassengersDF
  from mindsdb.integrations.utilities.time_series_utils import transform_to_nixtla_df, get_results_from_nixtla_df, infer_frequency, get_best_model_from_results_df, spec_hierarchy_from_list, get_hierarchy_from_df, reconcile_forecasts
label_desc: Use image node_id 2 for calling a global function with example usage: test_infer_frequency() without return types