code: def test_tsne_pickle(tmpdir):
      result = {}
  
      def create_mod():
          iris = load_iris()
          iris_selection = np.random.RandomState(42).choice(
              [True, False], 150, replace=True, p=[0.75, 0.25]
          )
          X = iris.data[iris_selection]
  
          model = cuml.manifold.TSNE(n_components=2, random_state=199)
          result["model"] = model
          return model, X
  
      def assert_model(pickled_model, X):
          model_params = pickled_model.__dict__
          # Confirm params in model are identical
          new_keys = set(model_params.keys())
          for key, value in zip(
              model_params.keys(), model_params.values()
          ):
              assert model_params[key] == value
              new_keys -= set([key])
  
          # Check all keys have been checked
          assert len(new_keys) == 0
  
          # Transform data
          result["fit_model"] = pickled_model.fit(X)
          result["data"] = X
          result["trust"] = trustworthiness(
              X, pickled_model.embedding_, n_neighbors=10
          )
  
      def create_mod_2():
          model = result["fit_model"]
          return model, result["data"]
  
      def assert_second_model(pickled_model, X):
          trust_after = trustworthiness(
              X, pickled_model.embedding_, n_neighbors=10
          )
          assert result["trust"] == trust_after
  
      pickle_save_load(tmpdir, create_mod, assert_model)
      pickle_save_load(tmpdir, create_mod_2, assert_second_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 19 for calling a global function with example usage: test_tsne_pickle(tmpdir) and returns: model,  X, model,  result