code: def test_neighbors_pickle(tmpdir, datatype, keys, data_info):
      if (
          data_info[0] == 500000
          and pytest.max_gpu_memory < 32
          and (
              "KNeighborsClassifier" in keys
              or "KNeighborsRegressor" in keys
          )
      ):
          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, k = data_info
          X_train, y_train, X_test = make_dataset(
              datatype, nrows, ncols, n_info
          )
  
          model = neighbor_models[keys]()
          if keys in k_neighbors_models.keys():
              model.fit(X_train, y_train)
          else:
              model.fit(X_train)
          (
              result["neighbors_D"],
              result["neighbors_I"],
          ) = model.kneighbors(X_test, n_neighbors=k)
          return model, X_test
  
      def assert_model(pickled_model, X_test):
          D_after, I_after = pickled_model.kneighbors(
              X_test, n_neighbors=data_info[3]
          )
          assert array_equal(result["neighbors_D"], D_after)
          assert array_equal(result["neighbors_I"], I_after)
  
      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 13 for calling a global function with example usage: test_neighbors_pickle(tmpdir, datatype, keys, data_info) and returns: model,  X_test