def METHOD_NAME(self, X: np.ndarray, y=None) -> np.ndarray:
    """Fit time series clusterer to training data.
    Parameters
    ----------
    X : np.ndarray (2d or 3d array of shape (n_instances, series_length) or shape
        (n_instances, n_dimensions, series_length))
        Training time series instances to cluster.
    y: ignored, exists for API consistency reasons.
    Returns
    -------
    self:
        Fitted estimator.
    """
    self._check_params(X)
    self._precomputed_pairwise = pairwise_distance(
        X, metric=self.metric, **self._distance_params
    )
    return super().METHOD_NAME(X, y)