code: def fit(self, X, y=None):
      if sklearn_check_version("1.2"):
          self._validate_params()
      elif sklearn_check_version("1.1"):
          check_scalar(
              self.n_oversamples,
              "n_oversamples",
              min_val=1,
              target_type=numbers.Integral,
          )
  
      if sklearn_check_version("0.23"):
          X = self._validate_data(
              X,
              dtype=[np.float64, np.float32],
              ensure_2d=True,
              copy=False,
              accept_sparse=True,
          )
      else:
          X = _check_array(
              X,
              dtype=[np.float64, np.float32],
              ensure_2d=True,
              copy=False,
              accept_sparse=True,
          )
  
      n_samples, n_features = X.shape
      n_sf_min = min(n_samples, n_features)
  
      if self.n_components is None:
          if self.svd_solver == "arpack":
              n_components = n_sf_min - 1
          else:
              n_components = n_sf_min
      else:
          n_components = self.n_components
  
      self._validate_n_components(
          n_components, n_samples, n_features, n_sf_min
      )
  
      self._fit_svd_solver = self.svd_solver
  
      if self._fit_svd_solver == "auto":
          if sklearn_check_version("1.1"):
              if max(X.shape) <= 500 or n_components == "mle":
                  self._fit_svd_solver = "full"
              elif 1 <= n_components < 0.8 * n_sf_min:
                  self._fit_svd_solver = "randomized"
              else:
                  self._fit_svd_solver = "full"
          else:
              if n_components == "mle":
                  self._fit_svd_solver = "full"
              else:
                  n, p, k = X.shape[0], X.shape[1], n_components
                  # check if sklearnex is faster than randomized sklearn
                  # Refer to daal4py
                  regression_coefs = np.array(
                      [
                          [9.779873e-11, n * p * k],
                          [-1.122062e-11, n * p * p],
                          [1.127905e-09, n**2],
                      ]
                  )
  
                  if (
                      n_components >= 1
                      and np.dot(
                          regression_coefs[:, 0], regression_coefs[:, 1]
                      )
                      <= 0
                  ):
                      self._fit_svd_solver = "randomized"
                  else:
                      self._fit_svd_solver = "full"
  
      dispatch(
          self,
          "fit",
          {
              "onedal": self.__class__._onedal_fit,
              "sklearn": sklearn_PCA.fit,
          },
          X,
      )
      return self
  
imports: import numbers
  from math import sqrt
  import numpy
  from scipy.sparse import issparse
  from sklearn.base import BaseEstimator
  from sklearn.utils.extmath import stable_cumsum
  from sklearn.utils.validation import check_array, check_is_fitted
  from daal4py.sklearn._utils import control_n_jobs, run_with_n_jobs, sklearn_check_version
  from onedal.utils import _check_array
  from ..._device_offload import dispatch
  from ..._utils import PatchingConditionsChain, register_hyperparameters
  from sklearn.decomposition import PCA
  from onedal.common.hyperparameters import get_hyperparameters
  from onedal.decomposition import PCA
label_desc: Use image node_id 3 for calling the PCA obj's underlying member method code with example usage: obj.fit(X, y) and returns: self