code: def test_unpivot_sp(sp, index_type, n_timepoints, anchor_side):
      """Test _unpivot_sp contract."""
      df = _make_series(
          n_timepoints=n_timepoints,
          n_columns=1,
          index_type=index_type,
          return_mtype="pd.DataFrame",
      )
      df.columns = ["foo"]
  
      df_pivot = _pivot_sp(df, sp, anchor_side=anchor_side)
  
      df_unpivot = _unpivot_sp(df=df_pivot, template=df)
  
      if index_type != "range":
          assert isinstance(df_pivot.index, type(df.index))
      else:
          pd.api.types.is_integer_dtype(df_pivot.index)
  
      assert len(df_unpivot) == len(df)
      assert np.all(df_unpivot.index == df.index)
      assert np.all(df_unpivot == df)
  
file_path: sktime/sktime/utils/tests/test_seasonal.py
imports: from math import ceil
  import numpy
  import pandas
  import pytest
  from sktime.utils._testing.series import _make_series
  from sktime.utils.seasonality import _pivot_sp, _unpivot_sp
label_desc: Use image node_id 2 for calling a global function with example usage: test_unpivot_sp(sp, index_type, n_timepoints, anchor_side) without return types