code: def test_series_lengths():
      pytest.importorskip("tensorflow")
      from tslearn.shapelets import LearningShapelets
  
      # Test long shapelets
      y = [0, 1]
      time_series = to_time_series_dataset([[1, 2, 3, 4, 5], [3, 2, 1]])
      clf = LearningShapelets(
          n_shapelets_per_size={8: 1},
          max_iter=1,
          verbose=0,
          random_state=0,
      )
      np.testing.assert_raises(ValueError, clf.fit, time_series, y)
  
      # Test small max_size
      y = [0, 1]
      time_series = to_time_series_dataset([[1, 2, 3, 4, 5], [3, 2, 1]])
      clf = LearningShapelets(
          n_shapelets_per_size={3: 1},
          max_iter=1,
          verbose=0,
          max_size=4,
          random_state=0,
      )
      np.testing.assert_raises(ValueError, clf.fit, time_series, y)
  
imports: import numpy
  import pytest
  from sklearn.model_selection import cross_validate
  from tslearn.utils import to_time_series, to_time_series_dataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_series_lengths() without return types