code: def test_get_cutoff_from_index(reverse_order):
      """Tests that _get_cutoff_from_index has correct output.
  
      Parameters
      ----------
      return_index : bool - whether index (True) or index element is returned (False)
      reverse_order : bool - whether first (True) or last index (False) is retrieved
  
      Raises
      ------
      AssertionError if _get_cutoff_from_index does not return a length 1 pandas.index
      AssertionError if _get_cutoff_from_index does not return the correct cutoff value
      """
      hier_fixture = _make_hierarchical()
      hier_idx = hier_fixture.index
  
      cutoff = _get_cutoff_from_index(
          hier_idx, return_index=True, reverse_order=reverse_order
      )
      idx = _get_cutoff_from_index(
          hier_idx, return_index=False, reverse_order=reverse_order
      )
  
      assert isinstance(cutoff, pd.DatetimeIndex) and len(cutoff) == 1
      assert cutoff.freq == "D"
      assert idx == cutoff[0]
  
      if reverse_order:
          assert idx == pd.Timestamp("2000-01-01")
      else:
          assert idx == pd.Timestamp("2000-01-12")
  
      series_fixture = get_examples("pd.Series")[0]
      series_idx = series_fixture.index
  
      cutoff = _get_cutoff_from_index(
          series_idx, return_index=True, reverse_order=reverse_order
      )
      idx = _get_cutoff_from_index(
          series_idx, return_index=False, reverse_order=reverse_order
      )
  
      assert isinstance(cutoff, pd.Index) and len(cutoff) == 1
      assert pd.api.types.is_integer_dtype(cutoff)
      assert idx == cutoff[0]
  
      if reverse_order:
          assert idx == 0
      else:
          assert idx == 3
  
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 3 for calling a global function with example usage: test_get_cutoff_from_index(reverse_order) without return types