class_docstr: Abstract base class for time series clusterer.
  
  Parameters
  ----------
  n_clusters: int, defaults = None
      Number of clusters for model.
class_docstr_tok: ["Abstract","base","class","for","time","series","clusterer",".","Parameters","--","--","--","--","--","n_clusters",":","int",",","defaults","=","None","Number","of","clusters","for","model","."]
docstr: Validate the input and prepare for _fit.
  
  Parameters
  ----------
  X : np.ndarray (2d or 3d array of shape (n_instances, series_length) or shape
      (n_instances,n_dimensions,series_length)) or nested pd.DataFrame (
      n_instances,n_dimensions).
      Training time series instances to cluster.
  
  Returns
  -------
  X : np.ndarray (3d of shape (n_instances,n_dimensions,series_length)) or
      pd.Dataframe (n_instances,n_dimensions).
      Converted X ready for _fit.
  
  Raises
  ------
  ValueError
      If y or X is invalid input data type, or there is not enough data.
docstr_tok: ["Validate","the","input","and","prepare","for","_fit",".","Parameters","--","--","--","--","--","X",":","np.ndarray","(","2d","or","3d","array","of","shape","(","n_instances",",","series_length",")","or","shape","(","n_instances",",","n_dimensions",",","series_length",")",")","or","nested","pd.DataFrame","(","n_instances",",","n_dimensions",")",".","Training","time","series","instances","to","cluster",".","Returns","--","--","--","-","X",":","np.ndarray","(","3d","of","shape","(","n_instances",",","n_dimensions",",","series_length",")",")","or","pd.Dataframe","(","n_instances",",","n_dimensions",")",".","Converted","X","ready","for","_fit",".","Raises","--","--","--","ValueError","If","y","or","X","is","invalid","input","data","type",",","or","there","is","not","enough","data","."]
code: def _check_clusterer_input(
      self, X: TimeSeriesInstances, enforce_min_instances: int = 1
  ) -> TimeSeriesInstances:
      """Validate the input and prepare for _fit.
  
      Parameters
      ----------
      X : np.ndarray (2d or 3d array of shape (n_instances, series_length) or shape
          (n_instances,n_dimensions,series_length)) or nested pd.DataFrame (
          n_instances,n_dimensions).
          Training time series instances to cluster.
  
      Returns
      -------
      X : np.ndarray (3d of shape (n_instances,n_dimensions,series_length)) or
          pd.Dataframe (n_instances,n_dimensions).
          Converted X ready for _fit.
  
      Raises
      ------
      ValueError
          If y or X is invalid input data type, or there is not enough data.
      """
      X = self._initial_conversion(X)
  
      ALLOWED_SCITYPES = [
          "Panel",
      ]
      FORBIDDEN_MTYPES = []
  
      mtypes_messages = []
      for scitype in ALLOWED_SCITYPES:
          mtypes = set(scitype_to_mtype(scitype))
          mtypes = list(mtypes.difference(FORBIDDEN_MTYPES))
          mtypes_messages.append(f"For {scitype} scitype: {mtypes}")
  
      X_metadata_required = [
          "n_instances",
          "has_nans",
          "is_univariate",
          "is_equal_length",
      ]
      X_valid, _, X_metadata = check_is_scitype(
          X,
          scitype=ALLOWED_SCITYPES,
          return_metadata=X_metadata_required,
      )
      if not X_valid:
          raise TypeError(
              "X must be in a sktime compatible format, of scitype: "
              f"{', '.join(ALLOWED_SCITYPES)}. "
              "For instance a pandas.DataFrame must have a 2-level MultiIndex. "
              "In case of numpy array, it must be "
              "a 3D array as (num_instance, num_vars, series). "
              "If you think X is already is an sktime supported input format, "
              "run `sktime.datatypes.check_raise(X, MTYPE)` to diagnose the error, "
              "where MTYPE is the string of the type specification you want for X. "
              "Possible mtype specification strings are as follows: "
              f"{', '.join(mtypes_messages)}"
          )
  
      n_cases = X_metadata["n_instances"]
      if n_cases < enforce_min_instances:
          raise ValueError(
              f"Minimum number of cases required is {enforce_min_instances} but X "
              f"has : {n_cases}"
          )
      missing = X_metadata["has_nans"]
      multivariate = not X_metadata["is_univariate"]
      unequal = not X_metadata["is_equal_length"]
      self._check_capabilities(missing, multivariate, unequal)
      return convert_to(
          X,
          to_type=self.get_tag("X_inner_mtype"),
          as_scitype="Panel",
      )
  
imports: import time
  from typing import Any, Union
  import numpy
  import pandas
  from sktime.base import BaseEstimator
  from sktime.datatypes import check_is_scitype, convert_to, scitype_to_mtype
  from sktime.utils.sklearn import is_sklearn_transformer
  from sktime.utils.validation import check_n_jobs
  from sktime.utils.validation._dependencies import _check_estimator_deps
label_desc: Use image node_id 14 for calling the BaseClusterer obj's underlying member method code with example usage: obj._check_clusterer_input(X, enforce_min_instances) and returns: convert_to