code: def test_kshape():
      n, sz, d = 15, 10, 3
      rng = np.random.RandomState(0)
      time_series = rng.randn(n, sz, d)
      time_series = TimeSeriesScalerMeanVariance().fit_transform(
          time_series
      )
  
      ks = KShape(
          n_clusters=3, n_init=1, verbose=False, random_state=rng
      ).fit(time_series)
      dists = ks._cross_dists(time_series)
      np.testing.assert_allclose(ks.labels_, dists.argmin(axis=1))
      np.testing.assert_allclose(ks.labels_, ks.predict(time_series))
  
      assert (
          KShape(n_clusters=101, verbose=False, random_state=rng)
          .fit(time_series)
          ._X_fit
          is None
      )
  
file_path: tslearn/tslearn/tests/test_clustering.py
imports: import numpy
  from tslearn.utils import to_time_series_dataset, ts_size
  from tslearn.clustering import EmptyClusterError, TimeSeriesKMeans, KernelKMeans, KShape
  from tslearn.clustering.utils import _check_full_length, _check_no_empty_cluster
  from tslearn.metrics import cdist_dtw, cdist_soft_dtw
  from tslearn.preprocessing import TimeSeriesScalerMeanVariance
  from scipy.spatial.distance import cdist
label_desc: Use image node_id 5 for calling a global function with example usage: test_kshape() without return types