code: def make_knn_detector(k=5, aggregator=None, normalizer=None):
      knn_detector = KNN(
          k=k, aggregator=aggregator, normalizer=normalizer
      )
      x_ref = np.random.randn(100, 2)
      knn_detector.fit(x_ref)
      knn_detector.infer_threshold(x_ref, 0.1)
      return knn_detector
  
file_path: alibi-detect/alibi_detect/od/tests/test__knn/test__knn.py
imports: import pytest
  import numpy
  import torch
  from alibi_detect.od._knn import KNN
  from alibi_detect.od.pytorch.ensemble import AverageAggregator, TopKAggregator, MaxAggregator, MinAggregator, ShiftAndScaleNormalizer, PValNormalizer
  from alibi_detect.exceptions import NotFittedError, ThresholdNotInferredError
  from sklearn.datasets import make_moons
label_desc: Use image node_id 1 for calling a global function with example usage: make_knn_detector(k, aggregator, normalizer) and returns: knn_detector