code: def test_timebinner():
      """Test TimeBinner."""
      X, y = load_basic_motions(return_X_y=True)
  
      aggfunc = np.sum
      freq = 8
      idx = pd.interval_range(
          start=0, end=100, freq=freq, closed="left"
      )
      tb = TimeBinner(idx=idx, aggfunc=aggfunc)
      tb.fit(X)
      row = 1
      Xtb = tb.transform(X)
      assert np.isclose(
          np.sum(X.iloc[row, 0][freq : (2 * freq)]), Xtb.iloc[row, 1]
      )
  
file_path: sktime/sktime/transformations/panel/tests/test_timebinner.py
imports: import numpy
  import pandas
  import pytest
  from sktime.datasets import load_basic_motions
  from sktime.tests.test_switch import run_test_for_class
  from sktime.transformations.panel.reduce import TimeBinner
label_desc: Use image node_id 1 for calling a global function with example usage: test_timebinner() without return types