code: def test_k_neighbors_classifier_pickle(
      tmpdir, datatype, data_info, keys
  ):
      if (
          data_info[0] == 500000
          and "NearestNeighbors" in keys
          and pytest.max_gpu_memory < 32
      ):
          if pytest.adapt_stress_test:
              data_info[0] = data_info[0] * pytest.max_gpu_memory // 32
          else:
              pytest.skip(
                  "Insufficient GPU memory for this test."
                  "Re-run with 'CUML_ADAPT_STRESS_TESTS=True'"
              )
      result = {}
  
      def create_mod():
          nrows, ncols, n_info, n_classes, k = data_info
          X_train, y_train, X_test = make_classification_dataset(
              datatype, nrows, ncols, n_info, n_classes
          )
          model = k_neighbors_models[keys](n_neighbors=k)
          model.fit(X_train, y_train)
          result["neighbors"] = model.predict(X_test)
          return model, X_test
  
      def assert_model(pickled_model, X_test):
          D_after = pickled_model.predict(X_test)
          assert array_equal(result["neighbors"], D_after)
          state = pickled_model.__dict__
          assert state["n_indices"] == 1
          assert "_fit_X" in state
  
      pickle_save_load(tmpdir, create_mod, assert_model)
  
imports: from sklearn.model_selection import train_test_split
  from sklearn.manifold import trustworthiness
  from sklearn.datasets import load_iris, make_classification, make_regression
  from sklearn.base import clone
  from cuml.testing.utils import array_equal, unit_param, stress_param, ClassEnumerator, get_classes_from_package, compare_svm, compare_probabilistic_svm
  from cuml.tsa.arima import ARIMA
  import pytest
  import pickle
  import cuml
  from cuml.internals.safe_imports import cpu_only_import, cpu_only_import_from
label_desc: Use image node_id 14 for calling a global function with example usage: test_k_neighbors_classifier_pickle(tmpdir, datatype, data_info, keys) and returns: model,  X_test