code: def tune_window(metric: str, train_X):
      """Tune window."""
      best_w = 0
      best_score = 0
      for w in np.arange(0, 1, 0.1):
          cls = TimeSeriesKMeans(
              metric=metric, distance_params={"window": w}
          )
          cls.fit(train_X)
          preds = cls.predict(train_X)
          print(" Preds type = ", type(preds))
          score = davies_bouldin_score(train_X, preds)
          print(score)
          if score > best_score:
              best_score = score
              best_w = w
      print("best window =", best_w, " with score ", best_score)
      return best_w
  
file_path: sktime/sktime/_contrib/clustering_experiments.py
imports: import os
  import sys
  import numpy
  import sklearn.metrics
  from sklearn.metrics import davies_bouldin_score
  from sklearn.model_selection import GridSearchCV
  from sklearn.preprocessing import normalize
  import sktime.datasets.tsc_dataset_names
  from sktime.benchmarking.experiments import run_clustering_experiment
  from sktime.clustering.k_means import TimeSeriesKMeans
  from sktime.clustering.k_medoids import TimeSeriesKMedoids
  from sktime.datasets import load_from_tsfile
label_desc: Use image node_id 3 for calling a global function with example usage: tune_window(metric, train_X) and returns: best_w