code: def fit_PCA_detector(detector):
      pca_detector = detector()
      x_ref = np.random.randn(100, 3)
      pca_detector.fit(x_ref)
      pca_detector.infer_threshold(x_ref, 0.1)
      return pca_detector
  
file_path: alibi-detect/alibi_detect/od/tests/test__pca/test__pca.py
imports: import pytest
  import numpy
  import torch
  from alibi_detect.utils.pytorch.kernels import GaussianRBF
  from alibi_detect.od._pca import PCA
  from alibi_detect.exceptions import NotFittedError
  from sklearn.datasets import make_moons
label_desc: Use image node_id 1 for calling a global function with example usage: fit_PCA_detector(detector) and returns: pca_detector