code: def test_random_intervals_on_basic_motions():
      """Test of RandomIntervals on basic motions data."""
      # load basic motions data
      X_train, y_train = load_basic_motions(split="train")
      indices = np.random.RandomState(4).choice(
          len(y_train), 5, replace=False
      )
  
      # fit random intervals
      ri = RandomIntervals(random_state=0, n_intervals=3)
      data = ri.fit_transform(X_train.iloc[indices], y_train[indices])
  
      # assert transformed data is the same
      testing.assert_array_almost_equal(
          data, random_intervals_basic_motions_data, decimal=4
      )
  
file_path: sktime/sktime/transformations/panel/tests/test_intervals.py
imports: import numpy
  import pytest
  from numpy import testing
  from sktime.datasets import load_basic_motions
  from sktime.tests.test_switch import run_test_for_class
  from sktime.transformations.panel.random_intervals import RandomIntervals
  from sktime.transformations.panel.supervised_intervals import SupervisedIntervals
label_desc: Use image node_id 1 for calling a global function with example usage: test_random_intervals_on_basic_motions() without return types