code: def test_variable_length_clustering():
      # TODO: here we just check that they can accept variable-length TS, not
      # that they do clever things
      X = to_time_series_dataset(
          [[1, 2, 3, 4], [1, 2, 3], [2, 5, 6, 7, 8, 9], [3, 5, 6, 7, 8]]
      )
      rng = np.random.RandomState(0)
  
      clf = KernelKMeans(n_clusters=2, random_state=rng)
      clf.fit(X)
  
      clf = TimeSeriesKMeans(
          n_clusters=2, metric="dtw", random_state=rng
      )
      clf.fit(X)
  
      clf = TimeSeriesKMeans(
          n_clusters=2, metric="softdtw", random_state=rng
      )
      clf.fit(X)
  
file_path: tslearn/tslearn/tests/test_variablelength.py
imports: import numpy
  from numpy.testing import assert_allclose, assert_array_less
  from sklearn.model_selection import cross_val_score, KFold
  from tslearn.neighbors import KNeighborsTimeSeriesClassifier
  from tslearn.preprocessing import TimeSeriesScalerMeanVariance
  from tslearn.svm import TimeSeriesSVC, TimeSeriesSVR
  from tslearn.clustering import KernelKMeans, TimeSeriesKMeans
  from tslearn.utils import to_time_series_dataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_variable_length_clustering() without return types