code: def check_clustering(name, clusterer_orig, readonly_memmap=False):
      clusterer = clone(clusterer_orig)
      X, y = _create_small_ts_dataset()
      X, y = shuffle(X, y, random_state=7)
      X = TimeSeriesScalerMeanVariance().fit_transform(X)
      rng = np.random.RandomState(42)
      X_noise = X + (rng.randn(*X.shape) / 5)
  
      n_samples, n_features, dim = X.shape
      # catch deprecation and neighbors warnings
      if hasattr(clusterer, "n_clusters"):
          clusterer.set_params(n_clusters=3)
      set_random_state(clusterer)
  
      # fit
      clusterer.fit(X)
      # with lists
      clusterer.fit(X.tolist())
  
      pred = clusterer.labels_
      assert_equal(pred.shape, (n_samples,))
      assert_greater(adjusted_rand_score(pred, y), 0.4)
  
      if clusterer._get_tags()["non_deterministic"]:
          return
  
      set_random_state(clusterer)
      with warnings.catch_warnings(record=True):
          pred2 = clusterer.fit_predict(X)
      assert_array_equal(pred, pred2)
  
      # fit_predict(X) and labels_ should be of type int
      assert pred.dtype in [np.dtype("int32"), np.dtype("int64")]
      assert pred2.dtype in [np.dtype("int32"), np.dtype("int64")]
  
      # Add noise to X to test the possible values of the labels
      labels = clusterer.fit_predict(X_noise)
  
      # There should be at least one sample in every original cluster
      labels_sorted = np.unique(labels)
      assert_array_equal(labels_sorted, np.arange(0, 3))
  
      # Labels should be less than n_clusters - 1
      if hasattr(clusterer, "n_clusters"):
          n_clusters = getattr(clusterer, "n_clusters")
          assert_greater_equal(n_clusters - 1, labels_sorted[-1])
  
imports: from tslearn.generators import random_walk_blobs
  from tslearn.preprocessing import TimeSeriesScalerMeanVariance
  import sklearn
  import warnings
  from sklearn.base import clone
  from sklearn.base import is_classifier, is_outlier_detector, is_regressor
  from sklearn.base import ClusterMixin
  from sklearn.exceptions import DataConversionWarning
  from sklearn.datasets import make_blobs
  from sklearn.metrics.pairwise import rbf_kernel, linear_kernel, pairwise_distances
  from sklearn.utils import shuffle
  from sklearn.utils.estimator_checks import check_classifiers_predictions, check_fit2d_1sample, check_fit2d_1feature, check_fit1d, check_get_params_invariance, check_set_params, check_dict_unchanged, check_dont_overwrite_parameters, check_estimators_data_not_an_array, check_fit2d_predict1d, check_methods_subset_invariance, check_regressors_int
  from sklearn.exceptions import SkipTestWarning
  from sklearn.utils.estimator_checks import _yield_classifier_checks, _yield_regressor_checks, _yield_transformer_checks, _yield_clustering_checks, _yield_outliers_checks, _is_pairwise_metric
  from sklearn.metrics import adjusted_rand_score, accuracy_score
  from sklearn.model_selection import ShuffleSplit
  from sklearn.model_selection._validation import _safe_split
  from sklearn.pipeline import make_pipeline
  from tslearn.clustering import TimeSeriesKMeans
  import warnings
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: check_clustering(name, clusterer_orig, readonly_memmap) without return types