code: def test_set_freq() -> None:
      """Test frequency inference."""
      assert infer_freq(None) is None
  
      y = pd.Series(dtype=int)
      assert infer_freq(y) is None
  
      index = pd.date_range(start="2021-01-01", periods=1)
      y = pd.Series(index=index, dtype=int)
      assert infer_freq(y) == "D"
  
      index = pd.date_range(start="2021-01-01", periods=1, freq="M")
      y = pd.Series(index=index, dtype=int)
      assert infer_freq(y) == "M"
  
      y = pd.DataFrame(
          {"a": 1}, index=pd.date_range(start="2021-01-01", periods=1)
      )
      assert infer_freq(y) == "D"
  
      y = pd.DataFrame(
          {"a": 1},
          index=pd.date_range(start="2021-01-01", periods=1, freq="M"),
      )
      assert infer_freq(y) == "M"
  
      y = _bottom_hier_datagen(no_levels=2)
      y = VectorizedDF(
          X=y, iterate_as="Series", is_scitype="Hierarchical"
      )
      assert infer_freq(y) == "M"
  
file_path: sktime/sktime/utils/tests/test_datetime.py
imports: import datetime
  import numpy
  import pandas
  from sktime.datasets import load_airline
  from sktime.datatypes import VectorizedDF
  from sktime.datatypes._utilities import get_time_index
  from sktime.utils._testing.hierarchical import _bottom_hier_datagen
  from sktime.utils.datetime import _coerce_duration_to_int, _get_freq, infer_freq, set_hier_freq
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 4 for calling a global function with example usage: test_set_freq() without return types