code: def fit(self, X, y=None):
      self._fit_validation(X, y)
      dispatch(
          self,
          "fit",
          {
              "onedal": self.__class__._onedal_fit,
              "sklearn": sklearn_NearestNeighbors.fit,
          },
          X,
          None,
      )
      return self
  
imports: import warnings
  import numpy
  from sklearn import __version__
  from sklearn.neighbors._ball_tree import BallTree
  from sklearn.neighbors._base import VALID_METRICS
  from sklearn.neighbors._base import NeighborsBase
  from sklearn.neighbors._kd_tree import KDTree
  from sklearn.neighbors._unsupervised import NearestNeighbors
  from sklearn.utils.validation import _deprecate_positional_args, check_is_fitted
  from daal4py.sklearn._utils import control_n_jobs, run_with_n_jobs, sklearn_check_version
  from onedal.neighbors import NearestNeighbors
  from onedal.utils import _check_array, _num_features, _num_samples
  from .._device_offload import dispatch, wrap_output_data
  from .common import KNeighborsDispatchingBase
label_desc: Use image node_id 2 for calling the NearestNeighbors obj's underlying member method code with example usage: obj.fit(X, y) and returns: self