def METHOD_NAME(self, method_name, *data):
    class_name = self.__class__.__name__
    patching_status = PatchingConditionsChain(
        f"sklearn.cluster.{class_name}.{method_name}"
    )
    if method_name == "fit":
        X, y, sample_weight = data
        patching_status.and_conditions(
            [
                (
                    self.algorithm in ["auto", "brute"],
                    f"'{self.algorithm}' algorithm is not supported. "
                    "Only 'auto' and 'brute' algorithms are supported",
                ),
                (
                    self.metric == "euclidean"
                    or (self.metric == "minkowski" and self.p == 2),
                    f"'{self.metric}' (p={self.p}) metric is not supported. "
                    "Only 'euclidean' or 'minkowski' with p=2 metrics are supported.",
                ),
                (not sp.issparse(X), "X is sparse. Sparse input is not supported."),
            ]
        )
        return patching_status
    raise RuntimeError(f"Unknown method {method_name} in {self.__class__.__name__}")