def METHOD_NAME(self, X, y=None):
    self._fit_validation(X, y)
    dispatch(
        self,
        "fit",
        {
            "onedal": self.__class__._onedal_fit,
            "sklearn": sklearn_NearestNeighbors.METHOD_NAME,
        },
        X,
        None,
    )
    return self