code: def fit(self, X, y):
      import sklearn.neighbors
  
      self.n_neighbors = int(self.n_neighbors)
      self.p = int(self.p)
  
      self.estimator = sklearn.neighbors.KNeighborsRegressor(
          n_neighbors=self.n_neighbors, weights=self.weights, p=self.p
      )
  
      if y.ndim == 2 and y.shape[1] == 1:
          y = y.flatten()
  
      self.estimator.fit(X, y)
      return self
  
file_path: auto-sklearn/autosklearn/pipeline/components/regression/k_nearest_neighbors.py
imports: from typing import Optional
  from ConfigSpace.configuration_space import ConfigurationSpace
  from ConfigSpace.hyperparameters import CategoricalHyperparameter, UniformIntegerHyperparameter
  from autosklearn.askl_typing import FEAT_TYPE_TYPE
  from autosklearn.pipeline.components.base import AutoSklearnRegressionAlgorithm
  from autosklearn.pipeline.constants import DENSE, PREDICTIONS, SPARSE, UNSIGNED_DATA
label_desc: Use image node_id 2 for calling the KNearestNeighborsRegressor obj's underlying member method code with example usage: obj.fit(X, y) and returns: self