code: def test_umap_pickle(tmpdir, datatype, keys):
      result = {}
  
      def create_mod():
          X_train = load_iris().data
  
          model = umap_model[keys](output_type="numpy")
          cu_before_pickle_transform = model.fit_transform(X_train)
  
          result["umap_embedding"] = model.embedding_
          n_neighbors = model.n_neighbors
  
          result["umap"] = trustworthiness(
              X_train,
              cu_before_pickle_transform,
              n_neighbors=n_neighbors,
          )
          return model, X_train
  
      def assert_model(pickled_model, X_train):
          cu_after_embed = pickled_model.embedding_
  
          n_neighbors = pickled_model.n_neighbors
          assert array_equal(result["umap_embedding"], cu_after_embed)
  
          cu_trust_after = trustworthiness(
              X_train,
              pickled_model.transform(X_train),
              n_neighbors=n_neighbors,
          )
          assert cu_trust_after >= result["umap"] - 0.2
  
      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 9 for calling a global function with example usage: test_umap_pickle(tmpdir, datatype, keys) and returns: model,  X_train