code: def test_variable_cross_val():
      # 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],
              [1, 2, 3, 4],
              [1, 2, 3],
              [2, 5, 6, 7, 8, 9],
              [3, 5, 6, 7, 8],
              [2, 5, 6, 7, 8, 9],
              [3, 5, 6, 7, 8],
          ]
      )
      y = [0, 0, 0, 0, 1, 1, 1, 1]
      rng = np.random.RandomState(0)
  
      cv = KFold(n_splits=2, shuffle=True, random_state=rng)
      for estimator in [
          TimeSeriesSVC(kernel="gak", random_state=rng),
          TimeSeriesSVR(kernel="gak"),
          KNeighborsTimeSeriesClassifier(metric="dtw", n_neighbors=1),
          KNeighborsTimeSeriesClassifier(
              metric="softdtw", n_neighbors=1
          ),
      ]:
          # TODO: cannot test for clustering methods since they don't have a
          # score method yet
          cross_val_score(estimator, X=X, y=y, cv=cv)
  
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 4 for calling a global function with example usage: test_variable_cross_val() without return types