code: def test_kernel_kmeans():
      n, sz, d = 15, 10, 3
      rng = np.random.RandomState(0)
      time_series = rng.randn(n, sz, d)
  
      gak_km = KernelKMeans(
          n_clusters=3, verbose=False, max_iter=5, random_state=rng
      ).fit(time_series)
      np.testing.assert_allclose(
          gak_km.labels_, gak_km.predict(time_series)
      )
  
      gak_km = KernelKMeans(
          n_clusters=101, verbose=False, max_iter=5, random_state=rng
      ).fit(time_series)
      assert gak_km._X_fit is None
  
      gak_km = KernelKMeans(
          n_clusters=2,
          verbose=False,
          kernel="rbf",
          kernel_params={"gamma": 1.0},
          max_iter=5,
          random_state=rng,
      ).fit(time_series)
      assert gak_km.sigma_gak_ 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 3 for calling a global function with example usage: test_kernel_kmeans() without return types