code: def test_all_hyperparameters_regressor(sagemaker_session):
      knn = KNN(
          sagemaker_session=sagemaker_session,
          dimension_reduction_type="sign",
          dimension_reduction_target="2",
          index_type="faiss.Flat",
          index_metric="COSINE",
          faiss_index_ivf_nlists="auto",
          faiss_index_pq_m=1,
          **ALL_REQ_ARGS,
      )
      assert knn.hyperparameters() == dict(
          k=str(ALL_REQ_ARGS["k"]),
          sample_size=str(ALL_REQ_ARGS["sample_size"]),
          predictor_type=str(ALL_REQ_ARGS["predictor_type"]),
          dimension_reduction_type="sign",
          dimension_reduction_target="2",
          index_type="faiss.Flat",
          index_metric="COSINE",
          faiss_index_ivf_nlists="auto",
          faiss_index_pq_m="1",
      )
  
imports: from __future__ import absolute_import
  import pytest
  from mock import Mock, patch
  from sagemaker import image_uris
  from sagemaker.amazon.knn import KNN, KNNPredictor
  from sagemaker.amazon.amazon_estimator import RecordSet
  from sagemaker.session_settings import SessionSettings
label_desc: Use image node_id 4 for calling a global function with example usage: test_all_hyperparameters_regressor(sagemaker_session) without return types