code: def test_get_cutoff(
      scitype, mtype, return_index, reverse_order, convert_input
  ):
      """Tests that get_cutoff has correct output.
  
      Parameters
      ----------
      scitype : str - scitype of input
      mtype : str - mtype of input
      return_index : bool - whether index (True) or index element is returned (False)
      reverse_order : bool - whether first (True) or last index (False) is retrieved
      convert_input : bool - whether input is converted (True) or passed through (False)
  
      Raises
      ------
      AssertionError if get_cutoff does not return a length 1 pandas.index
          for any fixture example of given scitype, mtype
      """
      # retrieve example fixture
      fixtures = get_examples(
          mtype=mtype, as_scitype=scitype, return_metadata=True
      )
  
      for fixture_tuple in fixtures.values():
          fixture = fixture_tuple[0]
          fixture_metadata = fixture_tuple[2]
          fixture_equally_spaced = fixture_metadata.get(
              "is_equally_spaced", True
          )
          fixture_equal_index = fixture_metadata.get(
              "is_equal_index", True
          )
  
          if fixture is None:
              continue
  
          cutoff = get_cutoff(
              fixture,
              return_index=return_index,
              reverse_order=reverse_order,
              convert_input=convert_input,
          )
  
          if return_index:
              expected_types = pd.Index
              cutoff_val = cutoff[0]
          else:
              expected_types = (int, float, np.int64, pd.Timestamp)
              cutoff_val = cutoff
  
          msg = (
              f"incorrect return type of get_cutoff"
              f"expected {expected_types}, found {type(cutoff)}"
          )
  
          assert isinstance(cutoff, expected_types), msg
  
          if return_index:
              assert len(cutoff) == 1
              if isinstance(cutoff_val, (pd.Period, pd.Timestamp)):
                  assert hasattr(cutoff, "freq")
                  if fixture_equally_spaced and fixture_equal_index:
                      assert cutoff.freq is not None
  
          if isinstance(fixture, np.ndarray):
              if reverse_order:
                  assert cutoff_val == 0
              else:
                  assert cutoff_val > 0
  
          if mtype in ["pd.Series", "pd.DataFrame"]:
              if reverse_order:
                  assert cutoff_val == fixture.index[0]
              else:
                  assert cutoff_val == fixture.index[-1]
  
          if mtype in ["pd-multiindex", "pd_multiindex_hier"]:
              time_idx = fixture.index.get_level_values(-1)
              if reverse_order:
                  assert cutoff_val == time_idx.min()
              else:
                  assert cutoff_val == time_idx.max()
  
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 2 for calling a global function with example usage: test_get_cutoff(scitype, mtype, return_index, reverse_order, convert_input) without return types